[Python-checkins] CVS: python/dist/src/Lib/test test_urlparse.py,1.2,1.2.24.1

Michael Hudson mwh@users.sourceforge.net
Mon, 18 Mar 2002 05:03:42 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv14588/test

Modified Files:
      Tag: release22-maint
	test_urlparse.py 
Log Message:
amk's fix attached to 

[ 516299 ] urlparse can get fragments wrong



Index: test_urlparse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v
retrieving revision 1.2
retrieving revision 1.2.24.1
diff -C2 -d -r1.2 -r1.2.24.1
*** test_urlparse.py	5 Jan 2001 05:57:04 -0000	1.2
--- test_urlparse.py	18 Mar 2002 13:03:40 -0000	1.2.24.1
***************
*** 5,8 ****
--- 5,26 ----
  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