summaryrefslogtreecommitdiff
path: root/wsgitools/digest.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2009-07-04 00:30:45 +0200
committerHelmut Grohne <helmut@subdivi.de>2009-07-04 00:30:45 +0200
commit0a2744adb37d370c4421d9d991ca4b8c3031f8aa (patch)
tree697f38b78687b072f6ff3f772ef516f3ea2de8be /wsgitools/digest.py
parent5c100ff27e18e104aef4fd40e3538943c1f57c6c (diff)
downloadwsgitools-0a2744adb37d370c4421d9d991ca4b8c3031f8aa.tar.gz
two new digest doctests
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-xwsgitools/digest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index b4f9f36..b976b9b 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -42,6 +42,11 @@ def parse_digest_response(data, ret=dict()):
... except ValueError:
... print("ValueError")
ValueError
+ >>> try:
+ ... parse_digest_response('spam="egg"error')
+ ... except ValueError:
+ ... print("ValueError")
+ ValueError
"""
data = data.strip()
key, rest = data.split('=', 1) # raises ValueError
@@ -150,6 +155,8 @@ class StatelessNonceStore(NonceStoreBase):
True
>>> s.checknonce(n)
True
+ >>> s.checknonce(n.rsplit(':', 1)[0] + "bad hash")
+ False
"""
def __init__(self, maxage=300, secret=None):
"""