[Python-checkins] python/dist/src/Lib/test test_cookielib.py,
1.1.4.1, 1.1.4.2
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Thu Mar 3 11:55:59 CET 2005
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5901/Lib/test
Modified Files:
Tag: release24-maint
test_cookielib.py
Log Message:
Patch #1117454: Remove code to special-case cookies without values
in LWPCookieJar.
Index: test_cookielib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cookielib.py,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- test_cookielib.py 3 Mar 2005 10:47:38 -0000 1.1.4.1
+++ test_cookielib.py 3 Mar 2005 10:55:52 -0000 1.1.4.2
@@ -231,6 +231,24 @@
return cookie_hdr
+class FileCookieJarTests(TestCase):
+ def test_lwp_valueless_cookie(self):
+ # cookies with no value should be saved and loaded consistently
+ from cookielib import LWPCookieJar
+ filename = test_support.TESTFN
+ c = LWPCookieJar()
+ interact_netscape(c, "http://www.acme.com/", 'boo')
+ self.assertEqual(c._cookies["www.acme.com"]["/"]["boo"].value, None)
+ try:
+ c.save(filename, ignore_discard=True)
+ c = LWPCookieJar()
+ c.load(filename, ignore_discard=True)
+ finally:
+ try: os.unlink(filename)
+ except OSError: pass
+ self.assertEqual(c._cookies["www.acme.com"]["/"]["boo"].value, None)
+
+
class CookieTests(TestCase):
# XXX
# Get rid of string comparisons where not actually testing str / repr.
@@ -1636,6 +1654,7 @@
DateTimeTests,
HeaderTests,
CookieTests,
+ FileCookieJarTests,
LWPCookieTests,
)
More information about the Python-checkins
mailing list