UT: Modify ExploitTelem calls in UTs

This commit is contained in:
Shreya Malviya 2022-02-22 12:50:01 +05:30
parent afb7210179
commit dff5bde894
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import pytest
from infection_monkey.exploit.sshexec import SSHExploiter
from infection_monkey.model.host import VictimHost
from infection_monkey.telemetry.exploit_telem import ExploitTelem
from monkey.infection_monkey.i_puppet.i_puppet import ExploiterResultData
DOMAIN_NAME = "domain-name"
IP = "0.0.0.0"
@ -30,11 +31,13 @@ EXPLOITER_INFO = {
}
EXPLOITER_ATTEMPTS = []
RESULT = False
OS_LINUX = "linux"
ERROR_MSG = "failed because yolo"
@pytest.fixture
def exploit_telem_test_instance():
return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS)
return ExploitTelem(EXPLOITER_NAME, HOST, ExploiterResultData(RESULT, RESULT, OS_LINUX, EXPLOITER_INFO, EXPLOITER_ATTEMPTS, ERROR_MSG))
def test_exploit_telem_send(exploit_telem_test_instance, spy_send_telemetry):