summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urlparse.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-09-25 19:20:12 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-09-25 19:20:12 (GMT)
commit7dfb6e295b4e4a8a5554debaf93e260c30725f18 (patch)
tree86f0cc79f2cb6f477e069730b06bbecc89e0109a /Lib/test/test_urlparse.py
parente134158f236b7821ec92aa61cc5fe46e2a77170f (diff)
downloadcpython-7dfb6e295b4e4a8a5554debaf93e260c30725f18.zip
cpython-7dfb6e295b4e4a8a5554debaf93e260c30725f18.tar.gz
cpython-7dfb6e295b4e4a8a5554debaf93e260c30725f18.tar.bz2
Fix SF # 591713, Fix "file:" URL to have right no. of /'s, by Bruce Atherton
Add a test too. urljoin() would make file:/tmp/foo instead of file:///tmp/foo Bugfix candidate, I will backport.
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r--Lib/test/test_urlparse.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index d3efa9e..b821879 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -17,9 +17,14 @@ class UrlParseTestCase(unittest.TestCase):
('http', 'www.python.org', '/', '', '', 'abc')),
(RFC1808_BASE,
('http', 'a', '/b/c/d', 'p', 'q', 'f')),
+ ('file:///tmp/junk.txt',
+ ('file', '', '/tmp/junk.txt', '', '', '')),
]:
result = urlparse.urlparse(url)
self.assertEqual(result, expected)
+ # put it back together and it should be the same
+ result2 = urlparse.urlunparse(result)
+ self.assertEqual(result2, url)
def checkJoin(self, base, relurl, expected):
self.assertEqual(urlparse.urljoin(base, relurl), expected)