forked from p15670423/monkey
UT: Remove event queue's unsubscribing tests
This commit is contained in:
parent
f3ef99db64
commit
ae2ba0e068
|
@ -53,51 +53,3 @@ def test_subscribe_tags():
|
|||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 3
|
||||
assert subscriber.call_count == 1
|
||||
|
||||
|
||||
def test_unsubscribe_all():
|
||||
subscriber = MagicMock()
|
||||
|
||||
EventQueue.subscribe_all(subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 3
|
||||
assert subscriber.call_count == 3
|
||||
|
||||
EventQueue.unsubscribe_all(subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 6
|
||||
assert subscriber.call_count == 3
|
||||
|
||||
|
||||
def test_unsubscribe_types():
|
||||
subscriber = MagicMock()
|
||||
|
||||
EventQueue.subscribe_all(subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 3
|
||||
assert subscriber.call_count == 3
|
||||
|
||||
EventQueue.unsubscribe_types([EventType], subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 6
|
||||
assert subscriber.call_count == 5
|
||||
|
||||
|
||||
def test_unsubscribe_tags():
|
||||
subscriber = MagicMock()
|
||||
|
||||
EventQueue.subscribe_all(subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 3
|
||||
assert subscriber.call_count == 3
|
||||
|
||||
EventQueue.unsubscribe_tags([EVENT_TAG_1, EVENT_TAG_2], subscriber)
|
||||
EventQueue.publish(EventType)
|
||||
|
||||
assert event_queue_file.pub.sendMessage.call_count == 6
|
||||
assert subscriber.call_count == 4
|
||||
|
|
Loading…
Reference in New Issue