UT: Fix zerologon unit tests

This commit is contained in:
Ilija Lazoroski 2022-10-05 16:53:04 +02:00
parent d3a2fa8a4c
commit 9a261296e4
1 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,10 @@
from unittest.mock import MagicMock
import pytest
from common.event_queue import IAgentEventQueue
from infection_monkey.model import VictimHost
DOMAIN_NAME = "domain-name"
IP = "0.0.0.0"
NETBIOS_NAME = "NetBIOS Name"
@ -20,6 +25,8 @@ def zerologon_exploiter_object(monkeypatch):
obj = ZerologonExploiter()
monkeypatch.setattr(obj, "dc_name", NETBIOS_NAME, raising=False)
monkeypatch.setattr(obj, "report_login_attempt", mock_report_login_attempt)
monkeypatch.setattr(obj, "host", VictimHost(ip_addr="1.1.1.1"))
monkeypatch.setattr(obj, "agent_event_queue", MagicMock(spec=IAgentEventQueue))
return obj