mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-10 15:03:04 +00:00
Add docstrings to storage test helpers
This commit is contained in:
parent
7e26dd42e9
commit
bdfa667a22
@ -2988,6 +2988,8 @@ def remove_tags(s):
|
|||||||
|
|
||||||
def renderSynchronously(ss):
|
def renderSynchronously(ss):
|
||||||
"""
|
"""
|
||||||
|
Return fully rendered HTML document.
|
||||||
|
|
||||||
:param _StorageStatus ss: a StorageStatus instance.
|
:param _StorageStatus ss: a StorageStatus instance.
|
||||||
"""
|
"""
|
||||||
elem = StorageStatusElement(ss._storage, ss._nickname)
|
elem = StorageStatusElement(ss._storage, ss._nickname)
|
||||||
@ -2995,10 +2997,20 @@ def renderSynchronously(ss):
|
|||||||
return unittest.TestCase().successResultOf(deferred)
|
return unittest.TestCase().successResultOf(deferred)
|
||||||
|
|
||||||
def renderDeferred(ss):
|
def renderDeferred(ss):
|
||||||
|
"""
|
||||||
|
Return a `Deferred` HTML renderer.
|
||||||
|
|
||||||
|
:param _StorageStatus ss: a StorageStatus instance.
|
||||||
|
"""
|
||||||
elem = StorageStatusElement(ss._storage, ss._nickname)
|
elem = StorageStatusElement(ss._storage, ss._nickname)
|
||||||
return flattenString(None, elem)
|
return flattenString(None, elem)
|
||||||
|
|
||||||
class JSONRequest(Request):
|
class JSONRequest(Request):
|
||||||
|
"""
|
||||||
|
A Request with t=json argument added to it.
|
||||||
|
|
||||||
|
This is useful to invoke a Resouce.render_JSON() method.
|
||||||
|
"""
|
||||||
implements(IRequest)
|
implements(IRequest)
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
@ -3007,6 +3019,11 @@ class JSONRequest(Request):
|
|||||||
self.fields = {}
|
self.fields = {}
|
||||||
|
|
||||||
def renderJSON(resource):
|
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())
|
return resource.render(JSONRequest())
|
||||||
|
|
||||||
class MyBucketCountingCrawler(BucketCountingCrawler):
|
class MyBucketCountingCrawler(BucketCountingCrawler):
|
||||||
|
Loading…
Reference in New Issue
Block a user