summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2020-12-29 12:18:42 (GMT)
committerGitHub <noreply@github.com>2020-12-29 12:18:42 (GMT)
commit030a713183084594659aefd77b76fe30178e23c8 (patch)
treef1cbb34ad0b1c8ff42e08252205090865293a4ba /Lib/test/test_urllib2.py
parentc1af128f5a5893839536453dcc8b2ed7b95b3c3a (diff)
downloadcpython-030a713183084594659aefd77b76fe30178e23c8.zip
cpython-030a713183084594659aefd77b76fe30178e23c8.tar.gz
cpython-030a713183084594659aefd77b76fe30178e23c8.tar.bz2
Allow / character in username,password fields in _PROXY envvars. (#23973)
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 12ad6ae..9db23e6 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -1851,9 +1851,17 @@ class MiscTests(unittest.TestCase):
('ftp', 'joe', 'password', 'proxy.example.com')),
# Test for no trailing '/' case
('http://joe:password@proxy.example.com',
- ('http', 'joe', 'password', 'proxy.example.com'))
+ ('http', 'joe', 'password', 'proxy.example.com')),
+ # Testcases with '/' character in username, password
+ ('http://user/name:password@localhost:22',
+ ('http', 'user/name', 'password', 'localhost:22')),
+ ('http://username:pass/word@localhost:22',
+ ('http', 'username', 'pass/word', 'localhost:22')),
+ ('http://user/name:pass/word@localhost:22',
+ ('http', 'user/name', 'pass/word', 'localhost:22')),
]
+
for tc, expected in parse_proxy_test_cases:
self.assertEqual(_parse_proxy(tc), expected)