summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:53:37 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:53:37 (GMT)
commitde0eb249c61b6c0164b635f5afb0cbefec48cb04 (patch)
tree3de2d739e7bd6594326403cc0ac476e4a89126c5 /Lib/test/test_urllib.py
parentc881f1592f9a2890e1c26ae899351e1cf8b5d622 (diff)
downloadcpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.zip
cpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.tar.gz
cpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.tar.bz2
Fix Issue8123 - TypeError in urllib when trying to use HTTP authentication
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index cea153e..98308b6 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -190,6 +190,17 @@ Content-Type: text/html; charset=iso-8859-1
finally:
self.unfakehttp()
+ def test_userpass_inurl(self):
+ self.fakehttp(b"Hello!")
+ try:
+ fp = urlopen("http://user:pass@python.org/")
+ self.assertEqual(fp.readline(), b"Hello!")
+ self.assertEqual(fp.readline(), b"")
+ self.assertEqual(fp.geturl(), 'http://user:pass@python.org/')
+ self.assertEqual(fp.getcode(), 200)
+ finally:
+ self.unfakehttp()
+
class urlretrieve_FileTests(unittest.TestCase):
"""Test urllib.urlretrieve() on local files"""