In reality we cannot handle a Deferred here

... yet?  This code is invoked from an `__init__` where async is always
tricky.  Maybe we can invert the relationship someday.
This commit is contained in:
Jean-Paul Calderone 2019-08-20 09:28:05 -04:00
parent 21bf7fc25c
commit e62d2a5a27
3 changed files with 10 additions and 3 deletions

View File

@ -3114,7 +3114,7 @@ class IFoolscapStoragePlugin(IPlugin):
server portion of this plugin on the currently active connection,
or ``None`` if no connection has been established yet.
:rtype: ``Deferred`` firing with ``IStorageServer``
:rtype: ``IStorageServer``
"""
def get_client_resource(configuration):

View File

@ -446,7 +446,7 @@ class _FoolscapStorage(object):
permutation_seed = attr.ib()
tubid = attr.ib()
storage_server = attr.ib()
storage_server = attr.ib(validator=attr.validators.provides(IStorageServer))
_furl = attr.ib()
_short_description = attr.ib()

View File

@ -15,6 +15,9 @@ from testtools.matchers import (
AfterPreprocessing,
)
from zope.interface import (
implementer,
)
from zope.interface.verify import (
verifyObject,
)
@ -59,6 +62,7 @@ from allmydata.storage_client import (
)
from allmydata.interfaces import (
IConnectionStatus,
IStorageServer,
)
SOME_FURL = b"pb://abcde@nowhere/fake"
@ -381,6 +385,9 @@ class FoolscapStorageServers(unittest.TestCase):
"""
Instances of ``_FoolscapStorage`` provide ``IFoolscapStorageServer``.
"""
@implementer(IStorageServer)
class NotStorageServer(object):
pass
self.assertTrue(
verifyObject(
IFoolscapStorageServer,
@ -388,7 +395,7 @@ class FoolscapStorageServers(unittest.TestCase):
u"server-id",
SOME_FURL,
{u"permutation-seed-base32": base32.b2a(b"permutationseed")},
object(),
NotStorageServer(),
),
),
)