def test_callable(self): ls = shell.CommandWrapper('ls') with patch.object(ls, 'check_call') as mock_check_call: ls('-al') mock_check_call.assert_called_with('-al')
def test_check_output(self, mock_check_output): ls = shell.CommandWrapper('ls') ls.check_output('-al') mock_check_output.assert_called_with(['ls', '-al'])
def test_call(self, mock_call): ls = shell.CommandWrapper('ls') ls.call('-al') mock_call.assert_called_with(['ls', '-al'])
def test_Popen(self, mock_popen): ls = shell.CommandWrapper('ls') ls.Popen('-al') mock_popen.assert_called_with(['ls', '-al'])
def test_command_property(self): git = shell.CommandWrapper('git') self.assertEqual(git.command, ['git'])
def test_command_normalized(self): wrapper = shell.CommandWrapper(['ls', '-al', Path('/tmp')]) self.assertEqual(wrapper._command, ['ls', '-al', '/tmp'])