From 8246c439a8246093b03e3987d6c1496ebe73b81c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 25 Aug 2005 07:32:42 +0000 Subject: Correct test suite for #848017. --- Lib/Cookie.py | 3 ++- Lib/test/test_cookie.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Lib/Cookie.py b/Lib/Cookie.py index fa2e05e..20a2941 100644 --- a/Lib/Cookie.py +++ b/Lib/Cookie.py @@ -224,6 +224,7 @@ __all__ = ["CookieError","BaseCookie","SimpleCookie","SerialCookie", _nulljoin = ''.join _semispacejoin = '; '.join +_spacejoin = ' '.join # # Define an exception visible to External modules @@ -594,7 +595,7 @@ class BaseCookie(dict): items.sort() for K,V in items: L.append( '%s=%s' % (K,repr(V.value) ) ) - return '<%s: %s>' % (self.__class__.__name__, _semispacejoin(L)) + return '<%s: %s>' % (self.__class__.__name__, _spacejoin(L)) def js_output(self, attrs=None): """Return a string suitable for JavaScript.""" diff --git a/Lib/test/test_cookie.py b/Lib/test/test_cookie.py index 3e80b6f..c20beee 100644 --- a/Lib/test/test_cookie.py +++ b/Lib/test/test_cookie.py @@ -12,17 +12,17 @@ warnings.filterwarnings("ignore", cases = [ ('chips=ahoy; vienna=finger', {'chips':'ahoy', 'vienna':'finger'}), - ('keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;";', + ('keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"', {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}), # Check illegal cookies that have an '=' char in an unquoted value - ('keebler=E=mc2;', {'keebler' : 'E=mc2'}) + ('keebler=E=mc2', {'keebler' : 'E=mc2'}) ] for data, dict in cases: C = Cookie.SimpleCookie() ; C.load(data) print repr(C) - print str(C) + print C.output(sep='\n') for k, v in sorted(dict.iteritems()): print ' ', k, repr( C[k].value ), repr(v) verify(C[k].value == v) -- cgit v0.12