def test_put_help_stdin(self, argv_mock, stdin_mock): argv = ['SCRIPT_NAME', 'put'] argv_mock.__getitem__.side_effect = argv.__getitem__ stdin_mock.return_value = ["-h 'bar baz' quux"] args = get_arguments() self.assertEqual(args.sub_command, 'put') self.assertEqual(list(args.jobs), ["-h 'bar baz' quux"])
def test_put_help_argument(self, argv_mock): argv = ['SCRIPT_NAME', 'put', '-h', '--foo', 'bar baz', 'quux'] argv_mock.__getitem__.side_effect = argv.__getitem__ args = get_arguments() self.assertEqual(args.sub_command, 'put') self.assertEqual(list(args.jobs), ["-h --foo 'bar baz' quux"])