UT: Replace call_args comparison with assert_called_with in test_ping_scanner

This commit is contained in:
Ilija Lazoroski 2022-09-29 13:45:59 +02:00
parent 2ab86fa428
commit 66e8032ef3
1 changed files with 6 additions and 6 deletions

View File

@ -128,7 +128,7 @@ def test_linux_ping_success(patch_subprocess_running_ping_with_ping_output, mock
assert result.response_received
assert result.os == OperatingSystem.LINUX
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
@pytest.mark.usefixtures("set_os_linux")
@ -142,7 +142,7 @@ def test_linux_ping_no_response(
assert not result.response_received
assert result.os is None
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
@pytest.mark.usefixtures("set_os_windows")
@ -156,7 +156,7 @@ def test_windows_ping_success(
assert result.response_received
assert result.os == OperatingSystem.WINDOWS
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
@pytest.mark.usefixtures("set_os_windows")
@ -170,7 +170,7 @@ def test_windows_ping_no_response(
assert not result.response_received
assert result.os is None
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
def test_malformed_ping_command_response(
@ -183,7 +183,7 @@ def test_malformed_ping_command_response(
assert not result.response_received
assert result.os is None
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
@pytest.mark.usefixtures("patch_subprocess_running_ping_to_raise_timeout_expired")
@ -194,7 +194,7 @@ def test_timeout_expired(mock_agent_event_queue):
assert not result.response_received
assert result.os is None
assert mock_agent_event_queue.publish.call_count == 1
assert mock_agent_event_queue.publish.call_args[0][0] == event
mock_agent_event_queue.publish.assert_called_with(event)
@pytest.fixture