diff --git a/monkey/tests/unit_tests/conftest.py b/monkey/tests/unit_tests/conftest.py index d1470c167..2d5132da0 100644 --- a/monkey/tests/unit_tests/conftest.py +++ b/monkey/tests/unit_tests/conftest.py @@ -8,6 +8,7 @@ MONKEY_BASE_PATH = str(Path(__file__).parent.parent.parent) sys.path.insert(0, MONKEY_BASE_PATH) from common.agent_configuration import DEFAULT_AGENT_CONFIGURATION, AgentConfiguration # noqa: E402 +from common.events import AbstractEvent # noqa: E402 @pytest.fixture(scope="session") @@ -50,3 +51,17 @@ def monkey_configs_dir(data_for_tests_dir) -> Path: @pytest.fixture def default_agent_configuration() -> AgentConfiguration: return DEFAULT_AGENT_CONFIGURATION + + +@pytest.fixture +def event_queue_subscriber(): + def fn(event: AbstractEvent): + fn.call_count += 1 + fn.call_types.add(event.__class__) + fn.call_tags |= event.tags + + fn.call_count = 0 + fn.call_types = set() + fn.call_tags = set() + + return fn