summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2008-09-20 13:01:09 +0200
committerHelmut Grohne <helmut@subdivi.de>2008-09-20 13:01:09 +0200
commitfc762e9bdecc8bc173791be6648c2950aaced797 (patch)
tree1c74692b87648b4be678805137558f0a739f9cfe
parent20cd4381f5ebc203ae6bc0d616a4b71831f8b582 (diff)
downloadwsgitools-fc762e9bdecc8bc173791be6648c2950aaced797.tar.gz
added some examples/doctests for digest.parse_digest_response
-rwxr-xr-xwsgitools/digest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index c30d0e9..65560f6 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -15,6 +15,13 @@ sysrand = random.SystemRandom()
def parse_digest_response(data, ret=dict()):
"""internal
@raises ValueError:
+
+ >>> parse_digest_response('foo=bar')
+ {'foo': 'bar'}
+ >>> parse_digest_response('foo="bar"')
+ {'foo': 'bar'}
+ >>> sorted(parse_digest_response('foo="bar=qux",spam=egg').items())
+ [('foo', 'bar=qux'), ('spam', 'egg')]
"""
data = data.strip()
key, rest = data.split('=', 1) # raises ValueError