[Python-checkins] CVS: python/dist/src/Lib/test test_cookie.py,1.2,1.3
A.M. Kuchling
python-dev@python.org
Thu, 24 Aug 2000 04:56:40 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv31489
Modified Files:
test_cookie.py
Log Message:
Updated test suite: test repr() and str() of cookies, and test metadata
fields with quoted values (as in Path="/acme")
Index: test_cookie.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cookie.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_cookie.py 2000/08/19 15:57:32 1.2
--- test_cookie.py 2000/08/24 11:56:18 1.3
***************
*** 14,21 ****
for data, dict in cases:
C = Cookie.SimpleCookie() ; C.load(data)
! print C
for k, v in dict.items():
print ' ', k, repr( C[k].value ), repr(v)
assert C[k].value == v
C = Cookie.SimpleCookie()
--- 14,23 ----
for data, dict in cases:
C = Cookie.SimpleCookie() ; C.load(data)
! print repr(C)
! print str(C)
for k, v in dict.items():
print ' ', k, repr( C[k].value ), repr(v)
assert C[k].value == v
+ print C[k]
C = Cookie.SimpleCookie()
***************
*** 29,31 ****
--- 31,40 ----
print C.js_output()
print C.js_output(['path'])
+
+ # Try cookie with quoted meta-data
+ C = Cookie.SimpleCookie()
+ C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"')
+ assert C['Customer'].value == 'WILE_E_COYOTE'
+ assert C['Customer']['version'] == '1'
+ assert C['Customer']['path'] == '/acme'