forked from p15670423/monkey
UT: Replace fn() with SubscriberSpy callable
This commit is contained in:
parent
e1e119c27a
commit
59c58b3115
|
@ -19,14 +19,15 @@ def event_queue() -> IIslandEventQueue:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def event_queue_subscriber() -> Callable[..., None]:
|
def event_queue_subscriber() -> Callable[..., None]:
|
||||||
def fn(topic=pub.AUTO_TOPIC):
|
class SubscriberSpy:
|
||||||
fn.call_count += 1
|
call_count = 0
|
||||||
fn.call_topics |= {topic.getName()}
|
call_topics = set()
|
||||||
|
|
||||||
fn.call_count = 0
|
def __call__(self, topic=pub.AUTO_TOPIC):
|
||||||
fn.call_topics = set()
|
self.call_count += 1
|
||||||
|
self.call_topics |= {topic.getName()}
|
||||||
|
|
||||||
return fn
|
return SubscriberSpy()
|
||||||
|
|
||||||
|
|
||||||
def test_subscribe_publish__no_event_body(
|
def test_subscribe_publish__no_event_body(
|
||||||
|
|
Loading…
Reference in New Issue