Beispiel #1
0
 def __call__(self, parser, namespace, values, option_string=None):
     setattr(namespace, self.dest, parse_outputs_option(values))
Beispiel #2
0
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")
Beispiel #3
0
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")
Beispiel #4
0
def test_parsing_output_handlers():
    outputs = parse_outputs_option("pretty,xml,excel")
    assert outputs == ["pretty", "xml", "excel"]
Beispiel #5
0
def test_parsing_output_handlers():
    outputs = parse_outputs_option("pretty,artifact,excel")
    assert outputs == ["pretty", "artifact", "excel"]