summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:55:50 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:55:50 (GMT)
commitafef78f832d0f2eab287f4ce889baf4d68a4fc63 (patch)
treec5f4a471e648990fbfdc042e993a6d5b5d8c75f2 /Lib/test
parentf6df1ee171967b05186de1111810e184adbe5bfa (diff)
downloadcpython-afef78f832d0f2eab287f4ce889baf4d68a4fc63.zip
cpython-afef78f832d0f2eab287f4ce889baf4d68a4fc63.tar.gz
cpython-afef78f832d0f2eab287f4ce889baf4d68a4fc63.tar.bz2
Merged revisions 83415 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83415 | senthil.kumaran | 2010-08-01 23:23:37 +0530 (Sun, 01 Aug 2010) | 3 lines Fix Issue8123 - TypeError in urllib when trying to use HTTP authentication ........
Diffstat (limited to 'Lib/test')
-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 acd5577..c573f14 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -191,6 +191,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"""