mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 03:06:33 +00:00
Merge branch '3899.failed-server' of github.com:meejah/tahoe-lafs into 3899.failed-server
This commit is contained in:
commit
b751a3937a
@ -187,10 +187,10 @@ class StorageClientConfig(object):
|
||||
grid_manager_keys,
|
||||
)
|
||||
|
||||
def get_configured_storage_plugins(self):
|
||||
def get_configured_storage_plugins(self) -> dict[str, IFoolscapStoragePlugin]:
|
||||
"""
|
||||
:returns Dict[str, IFoolscapStoragePlugin]: a dict mapping names
|
||||
to instances for all available plugins
|
||||
:returns: a mapping from names to instances for all available
|
||||
plugins
|
||||
|
||||
:raises MissingPlugin: if the configuration asks for a plugin
|
||||
for which there is no corresponding instance (e.g. it is
|
||||
|
@ -186,7 +186,7 @@ class UnrecognizedAnnouncement(unittest.TestCase):
|
||||
def _tub_maker(self, overrides):
|
||||
return Service()
|
||||
|
||||
def native_storage_server(self, config=None):
|
||||
def native_storage_server(self, config: Optional[StorageClientConfig] = None) -> NativeStorageServer:
|
||||
"""
|
||||
Make a ``NativeStorageServer`` out of an unrecognizable announcement.
|
||||
"""
|
||||
@ -196,7 +196,7 @@ class UnrecognizedAnnouncement(unittest.TestCase):
|
||||
self._tub_maker,
|
||||
{},
|
||||
node_config=EMPTY_CLIENT_CONFIG,
|
||||
config=config or StorageClientConfig(),
|
||||
config=config if config is not None else StorageClientConfig(),
|
||||
)
|
||||
|
||||
def test_no_exceptions(self):
|
||||
@ -248,10 +248,10 @@ class UnrecognizedAnnouncement(unittest.TestCase):
|
||||
An exception is produced if the plugin is missing
|
||||
"""
|
||||
with self.assertRaises(MissingPlugin):
|
||||
_ = self.native_storage_server(
|
||||
self.native_storage_server(
|
||||
StorageClientConfig(
|
||||
storage_plugins={
|
||||
"nothing": {}
|
||||
"missing-plugin-name": {}
|
||||
}
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user