UT: Parametrize HTTPIslandAPIClient get_agent_signals test

This commit is contained in:
Ilija Lazoroski 2022-09-23 15:49:41 +02:00 committed by Mike Salvatore
parent edf0593d4a
commit d1fc4fa7f4
1 changed files with 4 additions and 3 deletions

View File

@ -456,15 +456,16 @@ def test_island_api_client_get_agent_signals__status_code(
island_api_client.get_agent_signals(agent_id=AGENT_ID)
def test_island_api_client_get_agent_signals(island_api_client):
@pytest.mark.parametrize("expected_timestamp", [TIMESTAMP, None])
def test_island_api_client_get_agent_signals(island_api_client, expected_timestamp):
with requests_mock.Mocker() as m:
m.get(ISLAND_URI)
island_api_client.connect(SERVER)
m.get(ISLAND_GET_AGENT_SIGNALS, json={"terminate": TIMESTAMP})
m.get(ISLAND_GET_AGENT_SIGNALS, json={"terminate": expected_timestamp})
actual_terminate_timestamp = island_api_client.get_agent_signals(agent_id=AGENT_ID)
assert actual_terminate_timestamp == TIMESTAMP
assert actual_terminate_timestamp == expected_timestamp
def test_island_api_client_get_agent_signals__bad_json(island_api_client):