diff --git a/newsfragments/3250.minor b/newsfragments/3250.minor new file mode 100644 index 000000000..e69de29bb diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index 35a88fe08..479bc8bb9 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -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): diff --git a/src/allmydata/storage_client.py b/src/allmydata/storage_client.py index 84d96cec0..4ddeb5244 100644 --- a/src/allmydata/storage_client.py +++ b/src/allmydata/storage_client.py @@ -452,7 +452,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() diff --git a/src/allmydata/test/test_storage_client.py b/src/allmydata/test/test_storage_client.py index b59b93347..fb56f5ecb 100644 --- a/src/allmydata/test/test_storage_client.py +++ b/src/allmydata/test/test_storage_client.py @@ -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(), ), ), )