UT: Modify unit tests for ExploitTelem and PostBreachTelem based on previous changes

This commit is contained in:
Shreya Malviya 2021-11-24 00:20:28 +05:30
parent 8c2eab4c2a
commit 57b710fb10
2 changed files with 2 additions and 4 deletions

View File

@ -19,7 +19,6 @@ HOST_AS_DICT = {
"default_tunnel": None,
"default_server": None,
}
EXPLOITER = SSHExploiter(HOST)
EXPLOITER_NAME = "SSHExploiter"
EXPLOITER_INFO = {
"display_name": SSHExploiter._EXPLOITED_SERVICE,
@ -35,7 +34,7 @@ RESULT = False
@pytest.fixture
def exploit_telem_test_instance():
return ExploitTelem(EXPLOITER, RESULT)
return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS)
def test_exploit_telem_send(exploit_telem_test_instance, spy_send_telemetry):

View File

@ -20,10 +20,9 @@ class StubSomePBA:
@pytest.fixture
def post_breach_telem_test_instance(monkeypatch):
PBA = StubSomePBA()
monkeypatch.setattr(PostBreachTelem, "_get_hostname_and_ip", lambda: (HOSTNAME, IP))
monkeypatch.setattr(PostBreachTelem, "_get_os", lambda: OS)
return PostBreachTelem(PBA, RESULT)
return PostBreachTelem(PBA_NAME, PBA_COMMAND, RESULT)
def test_post_breach_telem_send(post_breach_telem_test_instance, spy_send_telemetry):