From 43e45e14add31cb7dba0b35d9d0ad9d3cee8e145 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 10 Aug 2022 09:14:19 -0400 Subject: [PATCH] Common: Remove subscribe_all_event_types() https://github.com/guardicore/monkey/pull/2182#discussion_r942427831 --- monkey/common/event_queue/pypubsub_event_queue.py | 5 ----- .../common/event_queue/test_pypubsub_event_queue.py | 9 --------- 2 files changed, 14 deletions(-) diff --git a/monkey/common/event_queue/pypubsub_event_queue.py b/monkey/common/event_queue/pypubsub_event_queue.py index 7f56b1162..253e00836 100644 --- a/monkey/common/event_queue/pypubsub_event_queue.py +++ b/monkey/common/event_queue/pypubsub_event_queue.py @@ -24,11 +24,6 @@ class PyPubSubEventQueue(IEventQueue): # pypubsub.pub.subscribe needs a string as the topic/event name self._pypubsub_publisher.subscribe(listener=subscriber, topicName=event_type.__name__) - def subscribe_all_event_types(self, subscriber: Callable[[AbstractEvent], None]): - self._pypubsub_publisher.subscribe( - listener=subscriber, topicName=INTERNAL_ALL_EVENT_TYPES_TOPIC - ) - def subscribe_tag(self, tag: str, subscriber: Callable[[AbstractEvent], None]): self._pypubsub_publisher.subscribe(listener=subscriber, topicName=tag) diff --git a/monkey/tests/unit_tests/common/event_queue/test_pypubsub_event_queue.py b/monkey/tests/unit_tests/common/event_queue/test_pypubsub_event_queue.py index b018c5d89..aac31c0ae 100644 --- a/monkey/tests/unit_tests/common/event_queue/test_pypubsub_event_queue.py +++ b/monkey/tests/unit_tests/common/event_queue/test_pypubsub_event_queue.py @@ -92,12 +92,3 @@ def test_subscribe_tags(subscriber_1, subscriber_2, subscriber_1_calls, subscrib assert subscriber_1_calls == [EVENT_TAG_1] assert subscriber_2_calls == [EVENT_TAG_2] - - -@pytest.mark.usefixtures("subscriber_1", "subscriber_1_calls") -def test_subscribe_all_event_types(subscriber_1, subscriber_1_calls): - pypubsub_event_queue.subscribe_all_event_types(subscriber_1) - pypubsub_event_queue.publish(EventType) - pypubsub_event_queue.publish(EventType) - - assert subscriber_1_calls == [INTERNAL_ALL_EVENT_TYPES_TOPIC, INTERNAL_ALL_EVENT_TYPES_TOPIC]