def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, parse_outputs_option(values))
def test_bad_option_in_output_parser(): with pytest.raises(ValueError, match="The following output handlers are not existing: " "asd.\nAvailable options:.*pretty"): parse_outputs_option("pretty,asd")
def test_bad_option_in_output_parser(): with pytest.raises(argparse.ArgumentTypeError, match="Illegal output handlers: asd.\n" "Available options:.*tree"): parse_outputs_option("tree,asd")
def test_parsing_output_handlers(): outputs = parse_outputs_option("pretty,xml,excel") assert outputs == ["pretty", "xml", "excel"]
def test_parsing_output_handlers(): outputs = parse_outputs_option("pretty,artifact,excel") assert outputs == ["pretty", "artifact", "excel"]