diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-07-14 10:39:35 +0000 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-07-14 10:39:35 +0000 |
commit | 9a5bc1d0011740dce72e848fb741e5205ac1f1de (patch) | |
tree | 50afa7e9935a73701951b0d1950bbf007ca9b46a /Lib/urlparse.py | |
parent | a253dc1da04fa05600039c0e19a9a13878524ecd (diff) | |
download | cpython-git-9a5bc1d0011740dce72e848fb741e5205ac1f1de.tar.gz |
Merged revisions 82881 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82881 | senthil.kumaran | 2010-07-14 15:51:22 +0530 (Wed, 14 Jul 2010) | 3 lines
Fix Issue5842 - Moving the tests out of urllib.parse module
........
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r-- | Lib/urlparse.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py index e134770644..6261b24e78 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -395,72 +395,3 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): r.append((name, value)) return r - - -test_input = """ - http://a/b/c/d - - g:h = <URL:g:h> - http:g = <URL:http://a/b/c/g> - http: = <URL:http://a/b/c/d> - g = <URL:http://a/b/c/g> - ./g = <URL:http://a/b/c/g> - g/ = <URL:http://a/b/c/g/> - /g = <URL:http://a/g> - //g = <URL:http://g> - ?y = <URL:http://a/b/c/d?y> - g?y = <URL:http://a/b/c/g?y> - g?y/./x = <URL:http://a/b/c/g?y/./x> - . = <URL:http://a/b/c/> - ./ = <URL:http://a/b/c/> - .. = <URL:http://a/b/> - ../ = <URL:http://a/b/> - ../g = <URL:http://a/b/g> - ../.. = <URL:http://a/> - ../../g = <URL:http://a/g> - ../../../g = <URL:http://a/../g> - ./../g = <URL:http://a/b/g> - ./g/. = <URL:http://a/b/c/g/> - /./g = <URL:http://a/./g> - g/./h = <URL:http://a/b/c/g/h> - g/../h = <URL:http://a/b/c/h> - http:g = <URL:http://a/b/c/g> - http: = <URL:http://a/b/c/d> - http:?y = <URL:http://a/b/c/d?y> - http:g?y = <URL:http://a/b/c/g?y> - http:g?y/./x = <URL:http://a/b/c/g?y/./x> -""" - -def test(): - import sys - base = '' - if sys.argv[1:]: - fn = sys.argv[1] - if fn == '-': - fp = sys.stdin - else: - fp = open(fn) - else: - try: - from cStringIO import StringIO - except ImportError: - from StringIO import StringIO - fp = StringIO(test_input) - for line in fp: - words = line.split() - if not words: - continue - url = words[0] - parts = urlparse(url) - print '%-10s : %s' % (url, parts) - abs = urljoin(base, url) - if not base: - base = abs - wrapped = '<URL:%s>' % abs - print '%-10s = %s' % (url, wrapped) - if len(words) == 3 and words[1] == '=': - if wrapped != words[2]: - print 'EXPECTED', words[2], '!!!!!!!!!!' - -if __name__ == '__main__': - test() |