diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllib.py | 11 |
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""" |