def wrapper(cls: type[DataIoInterface]) -> type[DataIoInterface]: add_instantiated_plugin_to_registry( plugin_register_keys=format_names, plugin_class=cls, plugin_registry=__PluginRegistry.data_io, ) return cls
def wrapper(cls: type[ProjectIoInterface]) -> type[ProjectIoInterface]: add_instantiated_plugin_to_registry( plugin_register_keys=format_names, plugin_class=cls, plugin_registry=__PluginRegistry.project_io, plugin_set_func_name="set_project_plugin", ) return cls
def test_add_instantiated_plugin_to_register( plugin_register_key: str, plugin: type[_PluginInstantiableType], plugin_registry: MutableMapping[str, _PluginInstantiableType], ): """Add instantiated plugin""" add_instantiated_plugin_to_registry(plugin_register_key, plugin, plugin_registry, "set_plugin") assert plugin_register_key in plugin_registry assert plugin_registry[plugin_register_key].format == plugin_register_key
def test_add_instantiated_plugin_to_register_multiple_keys( plugin_register_keys: list[str], plugin: type[_PluginInstantiableType], plugin_registry: MutableMapping[str, _PluginInstantiableType], ): """Add instantiated plugin with multiple keys""" add_instantiated_plugin_to_registry(plugin_register_keys, plugin, plugin_registry, "set_plugin") for plugin_register_key in plugin_register_keys: assert plugin_register_key in plugin_registry assert plugin_registry[ plugin_register_key].format == plugin_register_key