forked from p34709852/monkey
UT: Parametrize HTTPIslandAPIClient get_agent_signals test
This commit is contained in:
parent
edf0593d4a
commit
d1fc4fa7f4
|
@ -456,15 +456,16 @@ def test_island_api_client_get_agent_signals__status_code(
|
||||||
island_api_client.get_agent_signals(agent_id=AGENT_ID)
|
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:
|
with requests_mock.Mocker() as m:
|
||||||
m.get(ISLAND_URI)
|
m.get(ISLAND_URI)
|
||||||
island_api_client.connect(SERVER)
|
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)
|
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):
|
def test_island_api_client_get_agent_signals__bad_json(island_api_client):
|
||||||
|
|
Loading…
Reference in New Issue