diff options
author | Helmut Grohne <helmut@subdivi.de> | 2009-07-04 00:30:45 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2009-07-04 00:30:45 +0200 |
commit | 0a2744adb37d370c4421d9d991ca4b8c3031f8aa (patch) | |
tree | 697f38b78687b072f6ff3f772ef516f3ea2de8be | |
parent | 5c100ff27e18e104aef4fd40e3538943c1f57c6c (diff) | |
download | wsgitools-0a2744adb37d370c4421d9d991ca4b8c3031f8aa.tar.gz |
two new digest doctests
-rwxr-xr-x | wsgitools/digest.py | 7 |
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): """ |