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

Jeremy Hylton python-dev@python.org
Thu, 14 Sep 2000 09:59:10 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4185/test

Modified Files:
	test_urllib.py 
Log Message:
Remove "," from the list of always_safe characters.  It is a reserved
character according to RFC 2396. Add some text to quote doc string
that explains the quoting rules better.

This closes SF Bug #114427.

Add _fast_quote operation that uses a dictionary instead of a list
when the standard set of safe characters is used.



Index: test_urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_urllib.py	2000/08/31 15:48:10	1.1
--- test_urllib.py	2000/09/14 16:59:07	1.2
***************
*** 13,14 ****
--- 13,32 ----
  test = urllib.quote(chars)
  assert test == expected, "urllib.quote problem"
+ test2 = urllib.unquote(expected)
+ assert test2 == chars
+ 
+ in1 = "abc/def"
+ out1_1 = "abc/def"
+ out1_2 = "abc%2fdef"
+ 
+ assert urllib.quote(in1) == out1_1, "urllib.quote problem"
+ assert urllib.quote(in1, '') == out1_2, "urllib.quote problem"
+ 
+ in2 = "abc?def"
+ out2_1 = "abc%3fdef"
+ out2_2 = "abc?def"
+ 
+ assert urllib.quote(in2) == out2_1, "urllib.quote problem"
+ assert urllib.quote(in2, '?') == out2_2, "urllib.quote problem"
+ 
+