UT: Move event_queue_subscriber fixture back to test_pypubsub_event_queue.py
This commit is contained in:
parent
11901b1835
commit
f510b89c08
|
@ -36,6 +36,20 @@ def event_queue() -> IEventQueue:
|
||||||
return PyPubSubEventQueue(Publisher())
|
return PyPubSubEventQueue(Publisher())
|
||||||
|
|
||||||
|
|
||||||
|
@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
|
||||||
|
|
||||||
|
|
||||||
def test_subscribe_all(event_queue: IEventQueue, event_queue_subscriber: EventSubscriber):
|
def test_subscribe_all(event_queue: IEventQueue, event_queue_subscriber: EventSubscriber):
|
||||||
event_queue.subscribe_all_events(event_queue_subscriber)
|
event_queue.subscribe_all_events(event_queue_subscriber)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ MONKEY_BASE_PATH = str(Path(__file__).parent.parent.parent)
|
||||||
sys.path.insert(0, MONKEY_BASE_PATH)
|
sys.path.insert(0, MONKEY_BASE_PATH)
|
||||||
|
|
||||||
from common.agent_configuration import DEFAULT_AGENT_CONFIGURATION, AgentConfiguration # noqa: E402
|
from common.agent_configuration import DEFAULT_AGENT_CONFIGURATION, AgentConfiguration # noqa: E402
|
||||||
from common.events import AbstractEvent # noqa: E402
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
|
@ -51,17 +50,3 @@ def monkey_configs_dir(data_for_tests_dir) -> Path:
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def default_agent_configuration() -> AgentConfiguration:
|
def default_agent_configuration() -> AgentConfiguration:
|
||||||
return DEFAULT_AGENT_CONFIGURATION
|
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
|
|
||||||
|
|
Loading…
Reference in New Issue