From f453ff21fd4715d96538b7402d289794be5da2ad Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 16 Aug 2022 13:25:03 +0530 Subject: [PATCH] UT: Pass event queue to MimikatzCredentialCollector's constructor in tests --- .../credential_collectors/test_mimikatz_collector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 40d5728dd..a1196f204 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 @@ -1,8 +1,10 @@ from typing import Sequence +from unittest.mock import MagicMock import pytest from common.credentials import Credentials, LMHash, NTHash, Password, Username +from common.event_queue import IEventQueue from infection_monkey.credential_collectors import MimikatzCredentialCollector from infection_monkey.credential_collectors.mimikatz_collector.windows_credentials import ( WindowsCredentials, @@ -18,7 +20,8 @@ def patch_pypykatz(win_creds: [WindowsCredentials], monkeypatch): def collect_credentials() -> Sequence[Credentials]: - return MimikatzCredentialCollector().collect_credentials() + mock_event_queue = MagicMock(spec=IEventQueue) + return MimikatzCredentialCollector(mock_event_queue).collect_credentials() @pytest.mark.parametrize(