diff options
author | Michael W. Hudson <mwh@python.net> | 2002-03-18 13:06:00 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-03-18 13:06:00 (GMT) |
commit | bd3e771a979de04e273f735e69fb8842006137be (patch) | |
tree | 9af3ccf4b84b034358b9ee4c23be964c2481b5ba /Lib/test/test_urlparse.py | |
parent | 5c137c225113764faae183034e7a85175a699ae2 (diff) | |
download | cpython-bd3e771a979de04e273f735e69fb8842006137be.zip cpython-bd3e771a979de04e273f735e69fb8842006137be.tar.gz cpython-bd3e771a979de04e273f735e69fb8842006137be.tar.bz2 |
amk's fix attached to
[ 516299 ] urlparse can get fragments wrong
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rw-r--r-- | Lib/test/test_urlparse.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 20336bc..48c526b 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -4,6 +4,24 @@ errors = 0 RFC1808_BASE = "http://a/b/c/d;p?q#f" +for url, expected in [('http://www.python.org', + ('http', 'www.python.org', '', '', '', '')), + ('http://www.python.org#abc', + ('http', 'www.python.org', '', '', '', 'abc')), + ('http://www.python.org/#abc', + ('http', 'www.python.org', '/', '', '', 'abc')), + (RFC1808_BASE, + ('http', 'a', '/b/c/d', 'p', 'q', 'f')), + ]: + result = urlparse.urlparse(url) + print "%-13s = %r" % (url, result) + if result != expected: + errors += 1 + print "urlparse(%r)" % url + print ("expected %r,\n" + " got %r") % (expected, result) +print + def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) |