UT: Fix zerologon unit tests
This commit is contained in:
parent
d3a2fa8a4c
commit
9a261296e4
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue