summaryrefslogtreecommitdiff
path: root/Lib/test/test_urlparse.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-05-19 08:12:46 +0800
committerSenthil Kumaran <senthil@uthcode.com>2012-05-19 08:12:46 +0800
commit15e848b0767c41e6badc45316d60aa588d7e5ac1 (patch)
tree7bee86a3995621b9c1e5246d4eb64fc7e87bfb23 /Lib/test/test_urlparse.py
parent43ae3ceab8dd65d184aef1773714a604984de38e (diff)
parent1be320ebdd5b1f46f32e32c83f3c1e982e2d27e2 (diff)
downloadcpython-git-15e848b0767c41e6badc45316d60aa588d7e5ac1.tar.gz
Issue9374 - Generic parsing of query and fragment portion of urls for any scheme
Diffstat (limited to 'Lib/test/test_urlparse.py')
-rwxr-xr-xLib/test/test_urlparse.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index ada0ca8788..578438159d 100755
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -636,11 +636,20 @@ class UrlParseTestCase(unittest.TestCase):
('s3', 'foo.com', '/stuff', '', '', ''))
self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff"),
('x-newscheme', 'foo.com', '/stuff', '', '', ''))
+ self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff?query#fragment"),
+ ('x-newscheme', 'foo.com', '/stuff', '', 'query', 'fragment'))
+ self.assertEqual(urllib.parse.urlparse("x-newscheme://foo.com/stuff?query"),
+ ('x-newscheme', 'foo.com', '/stuff', '', 'query', ''))
+
# And for bytes...
self.assertEqual(urllib.parse.urlparse(b"s3://foo.com/stuff"),
(b's3', b'foo.com', b'/stuff', b'', b'', b''))
self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff"),
(b'x-newscheme', b'foo.com', b'/stuff', b'', b'', b''))
+ self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff?query#fragment"),
+ (b'x-newscheme', b'foo.com', b'/stuff', b'', b'query', b'fragment'))
+ self.assertEqual(urllib.parse.urlparse(b"x-newscheme://foo.com/stuff?query"),
+ (b'x-newscheme', b'foo.com', b'/stuff', b'', b'query', b''))
def test_mixed_types_rejected(self):
# Several functions that process either strings or ASCII encoded bytes