Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_httpservers.py @ 47318:e1fcc3881cb6
Create http package. #2883.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Mon, 26 May 2008 16:32:26 +0000 |
| parents | f762a9ab69dd |
| children | f31e32a2013c |
line wrap: on
line diff
--- a/Lib/test/test_httpservers.py Mon May 26 16:26:37 2008 +0000 +++ b/Lib/test/test_httpservers.py Mon May 26 16:32:26 2008 +0000 @@ -4,16 +4,15 @@ 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 @@ 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 @@ 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 @@ def test_main(verbose=None): try: cwd = os.getcwd() - support.run_unittest(#BaseHTTPServerTestCase, + support.run_unittest(BaseHTTPServerTestCase, SimpleHTTPServerTestCase, CGIHTTPServerTestCase )
