diff Lib/test/test_httpservers.py @ 48334:5a416a6417d3

Make a new urllib package . It consists of code from urllib, urllib2, urlparse, and robotparser. The old modules have all been removed. The new package has five submodules: urllib.parse, urllib.request, urllib.response, urllib.error, and urllib.robotparser. The urllib.request.urlopen() function uses the url opener from urllib2. Note that the unittests have not been renamed for the beta, but they will be renamed in the future. Joint work with Senthil Kumaran.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Wed, 18 Jun 2008 20:49:58 +0000
parents f31e32a2013c
children 3b1b6142690a
line wrap: on
line diff
--- a/Lib/test/test_httpservers.py	Wed Jun 18 18:01:29 2008 +0000
+++ b/Lib/test/test_httpservers.py	Wed Jun 18 20:49:58 2008 +0000
@@ -11,7 +11,7 @@
 import sys
 import base64
 import shutil
-import urllib
+import urllib.parse
 import http.client
 import tempfile
 import threading
@@ -322,7 +322,8 @@
              (res.read(), res.getheader('Content-type'), res.status))
 
     def test_post(self):
-        params = urllib.urlencode({'spam' : 1, 'eggs' : 'python', 'bacon' : 123456})
+        params = urllib.parse.urlencode(
+            {'spam' : 1, 'eggs' : 'python', 'bacon' : 123456})
         headers = {'Content-type' : 'application/x-www-form-urlencoded'}
         res = self.request('/cgi-bin/file2.py', 'POST', params, headers)