diff options
author | Helmut Grohne <helmut@subdivi.de> | 2008-09-20 13:01:09 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2008-09-20 13:01:09 +0200 |
commit | fc762e9bdecc8bc173791be6648c2950aaced797 (patch) | |
tree | 1c74692b87648b4be678805137558f0a739f9cfe | |
parent | 20cd4381f5ebc203ae6bc0d616a4b71831f8b582 (diff) | |
download | wsgitools-fc762e9bdecc8bc173791be6648c2950aaced797.tar.gz |
added some examples/doctests for digest.parse_digest_response
-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 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 |