From 11901b18358a91c52aef2e09cbb2f7d9f43cf4be Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 17 Aug 2022 14:44:43 +0530 Subject: [PATCH] UT: Simplify variable logic in MimikatzCredentialCollector's event publishing test --- .../credential_collectors/test_mimikatz_collector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/tests/unit_tests/infection_monkey/credential_collectors/test_mimikatz_collector.py b/monkey/tests/unit_tests/infection_monkey/credential_collectors/test_mimikatz_collector.py index 7ad4a1834..aec06bfc1 100644 --- a/monkey/tests/unit_tests/infection_monkey/credential_collectors/test_mimikatz_collector.py +++ b/monkey/tests/unit_tests/infection_monkey/credential_collectors/test_mimikatz_collector.py @@ -121,9 +121,10 @@ def test_pypykatz_result_parsing_no_secrets(monkeypatch): def test_mimikatz_credentials_stolen_event_published(monkeypatch): mock_event_queue = MagicMock(spec=IEventQueue) - mock_subscriber = Mock() + mock_subscriber = mock_pypykatz_handler = Mock() monkeypatch.setattr( - "infection_monkey.credential_collectors.mimikatz_collector.pypykatz_handler", Mock() + "infection_monkey.credential_collectors.mimikatz_collector.pypykatz_handler", + mock_pypykatz_handler, ) for event_tag in MIMIKATZ_EVENT_TAGS: