mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
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:
parent
21bf7fc25c
commit
e62d2a5a27
@ -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):
|
||||
|
@ -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()
|
||||
|
@ -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(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user