forked from p34709852/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
|
||||
def event_queue_subscriber() -> Callable[..., None]:
|
||||
def fn(topic=pub.AUTO_TOPIC):
|
||||
fn.call_count += 1
|
||||
fn.call_topics |= {topic.getName()}
|
||||
class SubscriberSpy:
|
||||
call_count = 0
|
||||
call_topics = set()
|
||||
|
||||
fn.call_count = 0
|
||||
fn.call_topics = set()
|
||||
def __call__(self, topic=pub.AUTO_TOPIC):
|
||||
self.call_count += 1
|
||||
self.call_topics |= {topic.getName()}
|
||||
|
||||
return fn
|
||||
return SubscriberSpy()
|
||||
|
||||
|
||||
def test_subscribe_publish__no_event_body(
|
||||
|
|
Loading…
Reference in New Issue