Change _parse_line: add only info about saved files to result;
change _command_error: add list of errors;
add tests command_2 and test_wget_raises_command_error.
@@ -21,9 +21,9 @@ def test_wget_returns_proper_command_string(buffer_connection):
def test_wget_raises_connection_failure(buffer_connection):
command_output, expected_result = command_output_and_expected_result_connection_failure()
buffer_connection.remote_inject_response([command_output])
- sftp_cmd = Wget(connection=buffer_connection.moler_connection, options="")
+ wget_cmd = Wget(connection=buffer_connection.moler_connection, options="https://moler.google.com")
with pytest.raises(CommandFailure):
- sftp_cmd()
+ wget_cmd()
@pytest.fixture
@@ -36,3 +36,21 @@ Connecting to moler.google.com (moler.google.com)|2a00:1460:4001:81d::300e|:443.
moler@debian:~$"""
result = dict()
return data, result
+
+
+def test_wget_raises_command_error(buffer_connection):
+ command_output, expected_result = command_output_and_expected_result_command_error()
+ buffer_connection.remote_inject_response([command_output])
+ wget_cmd = Wget(connection=buffer_connection.moler_connection, options="-m")
+ with pytest.raises(CommandFailure):
+ wget_cmd()
+
+
+@pytest.fixture
+def command_output_and_expected_result_command_error():
+ data = """moler@debian:~$ wget -m
+wget: missing URL
+Usage: wget [OPTION]... [URL]...
+moler@debian:~$"""
+ result = dict()
+ return data, result
