예제 #1
0
파일: mutate_and_run.py 프로젝트: jsh/truth
def main(argv: list) -> None:
    """The big tent.
    :param list argv: All the args. sys.argv
    """

    params = parse_params(argv[1:])
    survey_range(params)
예제 #2
0
def test_defaults() -> None:
    """ParamParser defaults."""
    params = parse_params()
    assert params.loglevel == logging.ERROR
    assert params.wild_type == pwhich("true")
    assert not params.mutants
    assert not params.cmd_args
    assert not params.bit_range
    assert not params.bit_file
예제 #3
0
def test_range_and_file() -> None:
    """parse_param() understands --bit_range and --bit_file are mutually exclusive.."""
    with pytest.raises(SystemExit):
        parse_params(["--bit_file=/etc/passwd", "--bit_range=1:2"])
예제 #4
0
def test_bit_file() -> None:
    """parse_param() understands --bit_range."""
    params = parse_params(["--bit_file=/etc/passwd"])
    assert params.bit_file == "/etc/passwd"
예제 #5
0
def test_bit_range() -> None:
    """parse_param() understands --bit_range."""
    params = parse_params(["--bit_range=3:5"])
    assert params.bit_range == "3:5"
예제 #6
0
def test_mutants() -> None:
    """parse_param() understands --mutants."""
    params = parse_params(["--mutants=foobarmumble"])
    assert params.mutants == "foobarmumble"
예제 #7
0
def test_wild_type() -> None:
    """parse_param() understands --wild_type."""
    params = parse_params(["--wild_type=/etc/passwd"])
    assert params.wild_type == Path("/etc/passwd")
예제 #8
0
def test_debug() -> None:
    """parse_param() understands --debug."""
    params = parse_params(["--debug"])
    assert params.loglevel == logging.DEBUG
예제 #9
0
def test_verbose() -> None:
    """parse_param() understands --verbose."""
    params = parse_params(["--verbose"])
    assert params.loglevel == logging.INFO