summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.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.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.py')
-rw-r--r--Lib/test/test_urllib2.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index cb730e2..3386800 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -77,7 +77,7 @@ def test_request_headers_methods():
Note the case normalization of header names here, to .capitalize()-case.
This should be preserved for backwards-compatibility. (In the HTTP case,
normalization to .title()-case is done by urllib2 before sending headers to
- httplib).
+ http.client).
>>> url = "http://example.com"
>>> r = Request(url, headers={"Spam-eggs": "blah"})
@@ -348,12 +348,12 @@ class MockHTTPHandler(urllib2.BaseHandler):
self._count = 0
self.requests = []
def http_open(self, req):
- import mimetools, httplib, copy
+ import mimetools, http.client, copy
from io import StringIO
self.requests.append(copy.deepcopy(req))
if self._count == 0:
self._count = self._count + 1
- name = httplib.responses[self.code]
+ name = http.client.responses[self.code]
msg = mimetools.Message(StringIO(self.headers))
return self.parent.error(
"http", req, MockFile(), self.code, name, msg)
@@ -875,9 +875,8 @@ class HandlerTests(unittest.TestCase):
def test_cookie_redirect(self):
# cookies shouldn't leak into redirected requests
- from cookielib import CookieJar
-
- from test.test_cookielib import interact_netscape
+ from http.cookiejar import CookieJar
+ from test.test_http_cookiejar import interact_netscape
cj = CookieJar()
interact_netscape(cj, "http://www.example.com/", "spam=eggs")