def test_execute_format_array(self, check_output): execute(['some', 'command', '{key}'], replacements={'key': 'value'}) check_output.assert_called_with(['some', 'command', 'value'])
def test_execute_array(self, check_call, check_output): execute(['some', 'command']) check_output.assert_called_with(['some', 'command']) assert not check_call.called
def test_execute_quoted(self, check_output): execute('some command "with quote"') check_output.assert_called_with(['some', 'command', 'with quote'])
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'])
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
def test_execute_quoted(self, check_call, check_output): execute('some command "with quote"') check_output.assert_called_with(['some', 'command', 'with quote'])
def test_execute_format_array(self, check_output): execute(["some", "command", "{key}"], replacements={"key": "value"}) check_output.assert_called_with(["some", "command", "value"])
def test_execute_quoted(self, check_output): execute('some command "with quote"') check_output.assert_called_with(["some", "command", "with quote"])
def test_execute_array(self, check_call, check_output): execute(["some", "command"]) check_output.assert_called_with(["some", "command"]) assert not check_call.called
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