mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-30 09:48:56 +00:00
Add docstrings to storage test helpers
This commit is contained in:
parent
8b7ef33b3d
commit
72b8f72080
@ -2975,6 +2975,8 @@ def remove_tags(s):
|
||||
|
||||
def renderSynchronously(ss):
|
||||
"""
|
||||
Return fully rendered HTML document.
|
||||
|
||||
:param _StorageStatus ss: a StorageStatus instance.
|
||||
"""
|
||||
elem = StorageStatusElement(ss._storage, ss._nickname)
|
||||
@ -2982,10 +2984,20 @@ def renderSynchronously(ss):
|
||||
return unittest.TestCase().successResultOf(deferred)
|
||||
|
||||
def renderDeferred(ss):
|
||||
"""
|
||||
Return a `Deferred` HTML renderer.
|
||||
|
||||
:param _StorageStatus ss: a StorageStatus instance.
|
||||
"""
|
||||
elem = StorageStatusElement(ss._storage, ss._nickname)
|
||||
return flattenString(None, elem)
|
||||
|
||||
class JSONRequest(Request):
|
||||
"""
|
||||
A Request with t=json argument added to it.
|
||||
|
||||
This is useful to invoke a Resouce.render_JSON() method.
|
||||
"""
|
||||
implements(IRequest)
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
@ -2994,6 +3006,11 @@ class JSONRequest(Request):
|
||||
self.fields = {}
|
||||
|
||||
def renderJSON(resource):
|
||||
"""Exercise resouce.render_JSON()
|
||||
|
||||
:param _MultiFormatResource resouce: A `twisted.web.resouce.Resource`
|
||||
that contains a render_JSON() method.
|
||||
"""
|
||||
return resource.render(JSONRequest())
|
||||
|
||||
class MyBucketCountingCrawler(BucketCountingCrawler):
|
||||
|
Loading…
Reference in New Issue
Block a user