summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2_localnet.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-26 16:32:26 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-26 16:32:26 (GMT)
commit2442015af26321083d4a2d75c096c8b732f049b2 (patch)
tree24cb8bc1fd46815ecc6e795cfcc008e7a576c672 /Lib/test/test_urllib2_localnet.py
parent744c2cd32585c1aeb1b78063cc6dda740d59c0c0 (diff)
downloadcpython-2442015af26321083d4a2d75c096c8b732f049b2.zip
cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.gz
cpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.bz2
Create http package. #2883.
Diffstat (limited to 'Lib/test/test_urllib2_localnet.py')
-rw-r--r--Lib/test/test_urllib2_localnet.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index 6bf1820..6c877d9 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -4,29 +4,29 @@ import mimetools
import threading
import urlparse
import urllib2
-import BaseHTTPServer
+import http.server
import unittest
import hashlib
from test import support
# Loopback http server infrastructure
-class LoopbackHttpServer(BaseHTTPServer.HTTPServer):
+class LoopbackHttpServer(http.server.HTTPServer):
"""HTTP server w/ a few modifications that make it useful for
loopback testing purposes.
"""
def __init__(self, server_address, RequestHandlerClass):
- BaseHTTPServer.HTTPServer.__init__(self,
- server_address,
- RequestHandlerClass)
+ http.server.HTTPServer.__init__(self,
+ server_address,
+ RequestHandlerClass)
# Set the timeout of our listening socket really low so
# that we can stop the server easily.
self.socket.settimeout(1.0)
def get_request(self):
- """BaseHTTPServer method, overridden."""
+ """HTTPServer method, overridden."""
request, client_address = self.socket.accept()
@@ -188,7 +188,7 @@ class DigestAuthHandler:
# Proxy test infrastructure
-class FakeProxyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+class FakeProxyHandler(http.server.BaseHTTPRequestHandler):
"""This is a 'fake proxy' that makes it look like the entire
internet has gone down due to a sudden zombie invasion. It main
utility is in providing us with authentication support for
@@ -283,7 +283,7 @@ class ProxyAuthTests(unittest.TestCase):
def GetRequestHandler(responses):
- class FakeHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ class FakeHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
server_version = "TestHTTP/"
requests = []