def parse_create(arg_list): groups = group_by_keywords( arg_list, set(["op", "meta"]), implicit_first_group_key="options", group_repeated_keywords=["op"], ) parts = { "meta": prepare_options(groups.get("meta", [])), "options": prepare_options(groups.get("options", [])), "op": [ prepare_options(op) for op in build_operations(groups.get("op", [])) ], } return parts
def assert_raises_cmdline(self, arg_list): self.assertRaises(CmdLineInputError, lambda: parse_args.build_operations(arg_list))
def assert_produce(self, arg_list, result): self.assertEqual(result, parse_args.build_operations(arg_list))
def assert_raises_cmdline(self, arg_list): self.assertRaises( CmdLineInputError, lambda: parse_args.build_operations(arg_list) )
def assert_produce(self, arg_list, result): self.assertEqual(result, parse_args.build_operations(arg_list))