mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue 1432. Fixes a bug caused because of the evolution
of the RFC that describes the behaviour. Note that we now have the same behaviour than the current browsers.
This commit is contained in:
parent
7b9cb2579c
commit
23e3856b1e
2 changed files with 21 additions and 5 deletions
|
@ -6,6 +6,7 @@ import urllib.parse
|
|||
|
||||
RFC1808_BASE = "http://a/b/c/d;p?q#f"
|
||||
RFC2396_BASE = "http://a/b/c/d;p?q"
|
||||
RFC3986_BASE = "http://a/b/c/d;p?q"
|
||||
|
||||
class UrlParseTestCase(unittest.TestCase):
|
||||
|
||||
|
@ -167,8 +168,6 @@ class UrlParseTestCase(unittest.TestCase):
|
|||
def test_RFC2396(self):
|
||||
# cases from RFC 2396
|
||||
|
||||
self.checkJoin(RFC2396_BASE, '?y', 'http://a/b/c/?y')
|
||||
self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x')
|
||||
|
||||
self.checkJoin(RFC2396_BASE, 'g:h', 'g:h')
|
||||
self.checkJoin(RFC2396_BASE, 'g', 'http://a/b/c/g')
|
||||
|
@ -210,6 +209,14 @@ class UrlParseTestCase(unittest.TestCase):
|
|||
self.checkJoin(RFC2396_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x')
|
||||
self.checkJoin(RFC2396_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x')
|
||||
|
||||
#The following scenarios have been updated in RFC3986
|
||||
#self.checkJoin(RFC2396_BASE, '?y', 'http://a/b/c/?y')
|
||||
#self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x')
|
||||
|
||||
def test_RFC3986(self):
|
||||
self.checkJoin(RFC3986_BASE, '?y','http://a/b/c/d;p?y')
|
||||
self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x')
|
||||
|
||||
def test_urldefrag(self):
|
||||
for url, defrag, frag in [
|
||||
('http://python.org#frag', 'http://python.org', 'frag'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue