update killall test file
@@ -15,37 +15,8 @@ def test_calling_killall_returns_result_no_permit(buffer_connection):
command_output, expected_result = command_output_and_expected_result_no_permit()
buffer_connection.remote_inject_response([command_output])
killall_cmd = Killall(connection=buffer_connection.moler_connection, name="iperf")
- try:
+ with pytest.raises(CommandFailure, match=r'Command failed \'killall iperf\' with ERROR: Operation not permitted'):
killall_cmd()
- except CommandFailure as e:
- assert "Command failed 'killall iperf' with ERROR: Operation not permitted" == e.args[0]
-
-
-def test_calling_df_returns_result_verbose(buffer_connection):
- from moler.cmd.unix.killall import Killall
- command_output, expected_result = command_output_and_expected_result_verbose()
- buffer_connection.remote_inject_response([command_output])
- killall_cmd = Killall(connection=buffer_connection.moler_connection, is_verbose="-v", name="iperf")
- result = killall_cmd()
- assert result == expected_result
-
-
-def test_calling_df_returns_result_no_verbose(buffer_connection):
- from moler.cmd.unix.killall import Killall
- command_output, expected_result = command_output_and_expected_result_no_verbose()
- buffer_connection.remote_inject_response([command_output])
- killall_cmd = Killall(connection=buffer_connection.moler_connection, name="iperf")
- result = killall_cmd()
- assert result == expected_result
-
-
-def test_calling_df_returns_result_no_process(buffer_connection):
- from moler.cmd.unix.killall import Killall
- command_output, expected_result = command_output_and_expected_result_no_process()
- buffer_connection.remote_inject_response([command_output])
- killall_cmd = Killall(connection=buffer_connection.moler_connection, name="tshark")
- result = killall_cmd()
- assert result == expected_result
def test_killall_returns_proper_command_string(buffer_connection):
@@ -68,26 +39,3 @@ iperf: no process killed
result = {}
return data, result
-
-@pytest.fixture
-def command_output_and_expected_result_verbose():
- from moler.cmd.unix.killall import COMMAND_OUTPUT_verbose, COMMAND_RESULT_verbose
- data = COMMAND_OUTPUT_verbose
- result = COMMAND_RESULT_verbose
- return data, result
-
-
-@pytest.fixture
-def command_output_and_expected_result_no_verbose():
- from moler.cmd.unix.killall import COMMAND_OUTPUT_no_verbose, COMMAND_RESULT_no_verbose
- data = COMMAND_OUTPUT_no_verbose
- result = COMMAND_RESULT_no_verbose
- return data, result
-
-
-@pytest.fixture
-def command_output_and_expected_result_no_process():
- from moler.cmd.unix.killall import COMMAND_OUTPUT_no_process, COMMAND_RESULT_no_process
- data = COMMAND_OUTPUT_no_process
- result = COMMAND_RESULT_no_process
- return data, result
