diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2014-09-22 07:49:16 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2014-09-22 07:49:16 (GMT) |
commit | a66e3885fb7bafbe69d738f500a63bd6718b0076 (patch) | |
tree | 08fa3d6c998549cd24da7694eb9df1d06cf21129 /Lib/test/test_urlparse.py | |
parent | e6c27c9f6b381f1970e8639d298e87446dbf1a61 (diff) | |
download | cpython-a66e3885fb7bafbe69d738f500a63bd6718b0076.zip cpython-a66e3885fb7bafbe69d738f500a63bd6718b0076.tar.gz cpython-a66e3885fb7bafbe69d738f500a63bd6718b0076.tar.bz2 |
Issue #22278: Fix urljoin problem with relative urls, a regression observed
after changes to issue22118 were submitted.
Patch contributed by Demian Brecht and reviewed by Antoine Pitrou.
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r-- | Lib/test/test_urlparse.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 24c1856..cb323d3 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -380,6 +380,18 @@ class UrlParseTestCase(unittest.TestCase): # self.checkJoin(SIMPLE_BASE, '../../../g','http://a/../g') # self.checkJoin(SIMPLE_BASE, '/./g','http://a/./g') + # test for issue22118 duplicate slashes + self.checkJoin(SIMPLE_BASE + '/', 'foo', SIMPLE_BASE + '/foo') + + # Non-RFC-defined tests, covering variations of base and trailing + # slashes + self.checkJoin('http://a/b/c/d/e/', '../../f/g/', 'http://a/b/c/f/g/') + self.checkJoin('http://a/b/c/d/e', '../../f/g/', 'http://a/b/f/g/') + self.checkJoin('http://a/b/c/d/e/', '/../../f/g/', 'http://a/f/g/') + self.checkJoin('http://a/b/c/d/e', '/../../f/g/', 'http://a/f/g/') + self.checkJoin('http://a/b/c/d/e/', '../../f/g', 'http://a/b/c/f/g') + self.checkJoin('http://a/b/', '../../f/g/', 'http://a/f/g/') + def test_RFC2732(self): str_cases = [ ('http://Test.python.org:5432/foo/', 'test.python.org', 5432), |