aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-26 16:32:26 +0000
committerGeorg Brandl <georg@python.org>2008-05-26 16:32:26 +0000
commit2442015af26321083d4a2d75c096c8b732f049b2 (patch)
tree24cb8bc1fd46815ecc6e795cfcc008e7a576c672 /Lib/test/test_httpservers.py
parent744c2cd32585c1aeb1b78063cc6dda740d59c0c0 (diff)
downloadcpython-2442015af26321083d4a2d75c096c8b732f049b2.tar.gz
cpython-2442015af26321083d4a2d75c096c8b732f049b2.zip
Create http package. #2883.
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index cc79cb872c4..02be57a3b2b 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -4,16 +4,15 @@ Written by Cody A.W. Somerville <cody-somerville@ubuntu.com>,
Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest.
"""
-from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
-from SimpleHTTPServer import SimpleHTTPRequestHandler
-from CGIHTTPServer import CGIHTTPRequestHandler
+from http.server import BaseHTTPRequestHandler, HTTPServer, \
+ SimpleHTTPRequestHandler, CGIHTTPRequestHandler
import os
import sys
import base64
import shutil
import urllib
-import httplib
+import http.client
import tempfile
import threading
@@ -59,7 +58,7 @@ class BaseTestCase(unittest.TestCase):
self.thread.stop()
def request(self, uri, method='GET', body=None, headers={}):
- self.connection = httplib.HTTPConnection('localhost', self.PORT)
+ self.connection = http.client.HTTPConnection('localhost', self.PORT)
self.connection.request(method, uri, body, headers)
return self.connection.getresponse()
@@ -92,7 +91,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
- self.con = httplib.HTTPConnection('localhost', self.PORT)
+ self.con = http.client.HTTPConnection('localhost', self.PORT)
self.con.connect()
def test_command(self):
@@ -343,7 +342,7 @@ class CGIHTTPServerTestCase(BaseTestCase):
def test_main(verbose=None):
try:
cwd = os.getcwd()
- support.run_unittest(#BaseHTTPServerTestCase,
+ support.run_unittest(BaseHTTPServerTestCase,
SimpleHTTPServerTestCase,
CGIHTTPServerTestCase
)