summaryrefslogtreecommitdiff
path: root/src/mailman/rest/docs/helpers.rst
diff options
context:
space:
mode:
authorBarry Warsaw2014-12-15 20:01:53 -0500
committerBarry Warsaw2014-12-15 20:01:53 -0500
commit068634612210ea447dca21db416724cba88cd64d (patch)
tree1cbecf2aa182163aa61ec38269f526c9cd28a692 /src/mailman/rest/docs/helpers.rst
parentacf95993ceb605c71ad07a32a572ae1f0888a7de (diff)
downloadmailman-068634612210ea447dca21db416724cba88cd64d.tar.gz
mailman-068634612210ea447dca21db416724cba88cd64d.tar.zst
mailman-068634612210ea447dca21db416724cba88cd64d.zip
Diffstat (limited to 'src/mailman/rest/docs/helpers.rst')
-rw-r--r--src/mailman/rest/docs/helpers.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mailman/rest/docs/helpers.rst b/src/mailman/rest/docs/helpers.rst
index 2dd65bbb8..5614e6544 100644
--- a/src/mailman/rest/docs/helpers.rst
+++ b/src/mailman/rest/docs/helpers.rst
@@ -45,7 +45,7 @@ gets modified to contain the etag under the ``http_etag`` key.
>>> resource = dict(geddy='bass', alex='guitar', neil='drums')
>>> json_data = etag(resource)
>>> print(resource['http_etag'])
- "96e036d66248cab746b7d97047e08896fcfb2493"
+ "6929ecfbda2282980a4818fb75f82e812077f77a"
For convenience, the etag function also returns the JSON representation of the
dictionary after tagging, since that's almost always what you want.
@@ -58,7 +58,7 @@ dictionary after tagging, since that's almost always what you want.
>>> dump_msgdata(data)
alex : guitar
geddy : bass
- http_etag: "96e036d66248cab746b7d97047e08896fcfb2493"
+ http_etag: "6929ecfbda2282980a4818fb75f82e812077f77a"
neil : drums
@@ -82,7 +82,7 @@ On valid input, the validator can be used as a ``**keyword`` argument.
>>> def print_request(one, two, three):
... print(repr(one), repr(two), repr(three))
>>> print_request(**validator(FakeRequest))
- 1 u'two' True
+ 1 'two' True
On invalid input, an exception is raised.
@@ -129,15 +129,15 @@ However, if optional keys are missing, it's okay.
>>> def print_request(one, two, three, four=None, five=None):
... print(repr(one), repr(two), repr(three), repr(four), repr(five))
>>> print_request(**validator(FakeRequest))
- 1 u'two' True 4 5
+ 1 'two' True 4 5
>>> del FakeRequest.params['four']
>>> print_request(**validator(FakeRequest))
- 1 u'two' True None 5
+ 1 'two' True None 5
>>> del FakeRequest.params['five']
>>> print_request(**validator(FakeRequest))
- 1 u'two' True None None
+ 1 'two' True None None
But if the optional values are present, they must of course also be valid.