summaryrefslogtreecommitdiffstats
path: root/Doc/library/cookie.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-22 22:04:10 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-22 22:04:10 (GMT)
commite8f1b00372891ddf6e42886bff397c43dad7a4eb (patch)
treeed62d4d8c7055404bbfbd1382afadd443cce6944 /Doc/library/cookie.rst
parent7a45ab826e9b2ecaee49cc8fd206631395a48927 (diff)
downloadcpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.zip
cpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.tar.gz
cpython-e8f1b00372891ddf6e42886bff397c43dad7a4eb.tar.bz2
Enable doctest running for several other documents.
We have now over 640 doctests that are run with "make doctest".
Diffstat (limited to 'Doc/library/cookie.rst')
-rw-r--r--Doc/library/cookie.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/cookie.rst b/Doc/library/cookie.rst
index 5a5808f..72400fc 100644
--- a/Doc/library/cookie.rst
+++ b/Doc/library/cookie.rst
@@ -210,7 +210,10 @@ Morsel Objects
Example
-------
-The following example demonstrates how to use the :mod:`Cookie` module. ::
+The following example demonstrates how to use the :mod:`Cookie` module.
+
+.. doctest::
+ :options: +NORMALIZE_WHITESPACE
>>> import Cookie
>>> C = Cookie.SimpleCookie()
@@ -219,11 +222,11 @@ The following example demonstrates how to use the :mod:`Cookie` module. ::
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
>>> print C # generate HTTP headers
- Set-Cookie: sugar=wafer
Set-Cookie: fig=newton
- >>> print C.output() # same thing
Set-Cookie: sugar=wafer
+ >>> print C.output() # same thing
Set-Cookie: fig=newton
+ Set-Cookie: sugar=wafer
>>> C = Cookie.SmartCookie()
>>> C["rocky"] = "road"
>>> C["rocky"]["path"] = "/cookie"
@@ -234,8 +237,8 @@ The following example demonstrates how to use the :mod:`Cookie` module. ::
>>> C = Cookie.SmartCookie()
>>> C.load("chips=ahoy; vienna=finger") # load from a string (HTTP header)
>>> print C
- Set-Cookie: vienna=finger
Set-Cookie: chips=ahoy
+ Set-Cookie: vienna=finger
>>> C = Cookie.SmartCookie()
>>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
>>> print C