UT: Fix UTs as per changes to ExploiterResultData and ExploitTelem

This commit is contained in:
Shreya Malviya 2022-02-21 16:02:00 +05:30
parent 125412ee18
commit 1cce742692
2 changed files with 7 additions and 6 deletions

View File

@ -254,14 +254,14 @@ def test_exploiter_result_processing(
if ip.endswith(".1"): if ip.endswith(".1"):
if data["exploiter"].startswith("PowerShell"): if data["exploiter"].startswith("PowerShell"):
assert data["result"] assert data["propagation_result"]
else: else:
assert not data["result"] assert not data["propagation_result"]
elif ip.endswith(".3"): elif ip.endswith(".3"):
if data["exploiter"].startswith("PowerShell"): if data["exploiter"].startswith("PowerShell"):
assert not data["result"] assert not data["propagation_result"]
else: else:
assert data["result"] assert data["propagation_result"]
def test_scan_target_generation(telemetry_messenger_spy, mock_ip_scanner, mock_victim_host_factory): def test_scan_target_generation(telemetry_messenger_spy, mock_ip_scanner, mock_victim_host_factory):

View File

@ -34,13 +34,14 @@ RESULT = False
@pytest.fixture @pytest.fixture
def exploit_telem_test_instance(): def exploit_telem_test_instance():
return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS) return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS)
def test_exploit_telem_send(exploit_telem_test_instance, spy_send_telemetry): def test_exploit_telem_send(exploit_telem_test_instance, spy_send_telemetry):
exploit_telem_test_instance.send() exploit_telem_test_instance.send()
expected_data = { expected_data = {
"result": RESULT, "exploitation_result": RESULT,
"propagation_result": RESULT,
"machine": HOST_AS_DICT, "machine": HOST_AS_DICT,
"exploiter": EXPLOITER_NAME, "exploiter": EXPLOITER_NAME,
"info": EXPLOITER_INFO, "info": EXPLOITER_INFO,