cleanup, docstrings

This commit is contained in:
meejah 2020-06-12 23:05:32 -06:00 committed by Sajith Sasidharan
parent e481e37beb
commit 9420777810

View File

@ -49,8 +49,8 @@ __all__ = (
class _FakeTahoeRoot(Resource, object):
"""
This is a sketch of how an in-memory 'fake' of a Tahoe
WebUI. Ultimately, this will live in Tahoe
An in-memory 'fake' of a Tahoe WebUI root. Currently it only
implements (some of) the `/uri` resource.
"""
def __init__(self, uri=None):
@ -62,13 +62,6 @@ class _FakeTahoeRoot(Resource, object):
return self._uri.add_data(kind, data)
@attr.s
class _FakeCapability(object):
"""
"""
data=attr.ib()
KNOWN_CAPABILITIES = [
getattr(allmydata.uri, t).BASE_STRING
for t in dir(allmydata.uri)
@ -121,6 +114,8 @@ def capability_generator(kind):
class _FakeTahoeUriHandler(Resource, object):
"""
An in-memory fake of (some of) the `/uri` endpoint of a Tahoe
WebUI
"""
isLeaf = True
@ -232,6 +227,12 @@ class _SynchronousProducer(object):
def create_tahoe_treq_client(root=None):
"""
:param root: an instance created via `create_fake_tahoe_root`. The
caller might want a copy of this to call `.add_data` for example.
:returns: an instance of treq.client.HTTPClient wired up to
in-memory fakes of the Tahoe WebUI. Only a subset of the real
WebUI is available.
"""
if root is None: