Exemple #1
0
    def test_cmd_path(self, command_mock):
        command_instance = command_mock.return_value

        ulc = UnixLocalCommand(path="/a:/b")
        result = ulc.cmd("test command")

        assert result == command_instance.return_value
        command_mock.assert_called_once_with(cmd="sh", args=["-c"], path="/a:/b")
        command_instance.assert_called_once_with("test command")
Exemple #2
0
    def test_cmd(self, command_mock):
        command_instance = command_mock.return_value

        ulc = UnixLocalCommand()
        result = ulc.cmd('test command')

        assert result == command_instance.return_value
        command_mock.assert_called_once_with(cmd='sh', args=['-c'], path=None)
        command_instance.assert_called_once_with('test command')