Esempio n. 1
0
    def test_list_with_args(self, mock_shell):
        main()

        expectation = ['echo Working once', 'echo Working twice']

        for call, expectation_elem in zip(mock_shell.call_args_list, expectation):
            self.assertEqual(call[0][0], expectation_elem)
        self.assertEqual(len(mock_shell.call_args_list), len(expectation))
Esempio n. 2
0
 def test_print_command(self, mock_print):
     main()
     self.assertEqual(mock_print.call_args_list[0][0][0].command, 'echo Working')
Esempio n. 3
0
 def test_single_command_with_args(self, mock_shell):
     main()
     self.assertEqual(mock_shell.call_args_list[0][0][0], 'echo Working 123')