Пример #1
0
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
Пример #2
0
 def assert_raises_cmdline(self, arg_list):
     self.assertRaises(CmdLineInputError,
                       lambda: parse_args.build_operations(arg_list))
Пример #3
0
 def assert_produce(self, arg_list, result):
     self.assertEqual(result, parse_args.build_operations(arg_list))
Пример #4
0
 def assert_raises_cmdline(self, arg_list):
     self.assertRaises(
         CmdLineInputError,
         lambda: parse_args.build_operations(arg_list)
     )
Пример #5
0
 def assert_produce(self, arg_list, result):
     self.assertEqual(result, parse_args.build_operations(arg_list))