Skip to content

Commit e1f6d10

Browse files
committed
Add test cases involving ports
1 parent 313a68f commit e1f6d10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_urllib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,10 @@ def test_url2pathname_posix(self):
15331533
fn = urllib.request.url2pathname
15341534
self.assertEqual(fn('/foo/bar'), '/foo/bar')
15351535
self.assertRaises(urllib.error.URLError, fn, '//foo/bar')
1536+
self.assertRaises(urllib.error.URLError, fn, '//localhost:/foo/bar')
1537+
self.assertRaises(urllib.error.URLError, fn, '//:80/foo/bar')
1538+
self.assertRaises(urllib.error.URLError, fn, '//:/foo/bar')
1539+
self.assertRaises(urllib.error.URLError, fn, '//c:80/foo/bar')
15361540
self.assertEqual(fn('///foo/bar'), '/foo/bar')
15371541
self.assertEqual(fn('////foo/bar'), '//foo/bar')
15381542
self.assertEqual(fn('//localhost/foo/bar'), '/foo/bar')

0 commit comments

Comments
 (0)