Пример #1
0
 def test_execute_format_array(self, check_output):
     execute(['some', 'command', '{key}'], replacements={'key': 'value'})
     check_output.assert_called_with(['some', 'command', 'value'])
Пример #2
0
 def test_execute_array(self, check_call, check_output):
     execute(['some', 'command'])
     check_output.assert_called_with(['some', 'command'])
     assert not check_call.called
Пример #3
0
 def test_execute_quoted(self, check_output):
     execute('some command "with quote"')
     check_output.assert_called_with(['some', 'command', 'with quote'])
Пример #4
0
 def test_execute_format_array(self, check_call, check_output):
     execute(['some', 'command', '{key}'], replacements={'key': 'value'})
     check_output.assert_called_with(['some', 'command', 'value'])
Пример #5
0
 def test_execute_quiet(self, check_call, check_output):
     output = 'some output'
     check_output.return_value = output
     assert execute('some command') == output
     check_output.assert_called_with(['some', 'command'])
     assert not check_call.called
Пример #6
0
 def test_execute_array(self, check_call, check_output):
     execute(['some', 'command'])
     check_output.assert_called_with(['some', 'command'])
     assert not check_call.called
Пример #7
0
 def test_execute_quoted(self, check_call, check_output):
     execute('some command "with quote"')
     check_output.assert_called_with(['some', 'command', 'with quote'])
Пример #8
0
 def test_execute_quiet(self, check_call, check_output):
     output = 'some output'
     check_output.return_value = output
     assert execute('some command') == output
     check_output.assert_called_with(['some', 'command'])
     assert not check_call.called
Пример #9
0
 def test_execute_format_array(self, check_output):
     execute(["some", "command", "{key}"], replacements={"key": "value"})
     check_output.assert_called_with(["some", "command", "value"])
Пример #10
0
 def test_execute_quoted(self, check_output):
     execute('some command "with quote"')
     check_output.assert_called_with(["some", "command", "with quote"])
Пример #11
0
 def test_execute_array(self, check_call, check_output):
     execute(["some", "command"])
     check_output.assert_called_with(["some", "command"])
     assert not check_call.called
Пример #12
0
 def test_execute_quiet(self, check_call, check_output):
     output = "some output"
     check_output.return_value = output
     assert execute("some command") == output
     check_output.assert_called_with(["some", "command"])
     assert not check_call.called