mirror of
https://github.com/d9pouces/id_configurator.git
synced 2026-11-09 01:47:21 +01:00
20 lines
524 B
Python
20 lines
524 B
Python
from id_configurator.modules import base as base_module
|
|
from id_configurator.modules.base import Module, all_modules, register
|
|
|
|
|
|
def test_register_and_all_modules_are_isolated(monkeypatch) -> None:
|
|
monkeypatch.setattr(base_module, "_REGISTRY", [])
|
|
|
|
class DummyModule(Module):
|
|
name = "dummy"
|
|
|
|
def is_relevant(self, context) -> bool:
|
|
return True
|
|
|
|
def apply(self, context) -> None:
|
|
pass
|
|
|
|
register(DummyModule)
|
|
|
|
assert all_modules() == [DummyModule] # nosec B101
|