예제 #1
0
def test_partser_whithoud_driver(parser):
    """
    Whithout a specified driver parser will exit
    """
    with pytest.raises(SystemExit):
        parser = cli.create_parser()
        parser.parse_args([url])
예제 #2
0
def test_parser_without_driver():
    """
    Without a specified driver the parser will exit
    """
    with pytest.raises(SystemExit):
        parser = cli.create_parser()
        parser.parse_args([url])
예제 #3
0
def test_parser_with_unkown_driver():
    """
    The parser will exit if the driver name is unkown
    """
    parser = cli.create_parser()
    with pytest.raises(SystemExit):
        parser.parse_args([url, "--driver", 'azure', 'destination'])
예제 #4
0
파일: test_cli.py 프로젝트: ss2k18/pgbackup
def test_parser_with_driver():
    """
    The parser will exit if it receives a driver without a destination
    """
    parser = cli.create_parser()
    with pytest.raises(SystemExit):
        parser.parse_args([url, "--driver", "local"])
예제 #5
0
def test_parser_without_driver():
    """
    Without a specified driver the parser will exit
    """
    with pytetst.raises(SystemExit):
        parser = cli.create_parser()
        parser.parse_args([url])
예제 #6
0
def test_parser_with_unknown_driver(parser):
    """
    The parser will exit if the driver is unknown.
    """
    parser = cli.create_parser()
    with pytest.raises(SystemExit):
        parser.parse_args([url, '--driver', 'azure', 'destination'])
예제 #7
0
def test_parser_with_driver(parser):
    """
    The parser will exit if it receives a driver without a destination.
    """
    parser = cli.create_parser()
    with pytest.raises(SystemExit):
        parser.parse_args([url, '--dirver', 'local'])
예제 #8
0
def test_parser_with_known_driver(parser):
    """
    The parser will not exit if the driver name is known
    """
    parser = cli.create_parser()
    for driver in ['local', 's3']:
        assert parser.parse_args([url, '--driver', driver, 'destination'])
예제 #9
0
def test_parser_with_known_drivers():
    """
    The parser will not exit if the driver name is known.
    """
    parser = cli.create_parser()

    for driver in ['local', 's3']:
        assert parser.parse_args([url, "--driver", driver, "destination"])
예제 #10
0
def test_parser_with_driver_and_destination(parser):
    """
    The parser will not exit if it receives a driver and a destination
    """
    parser = cli.create_parser()
    args = parser.parse_args([url, '--driver', 'local', '/some/path'])

    assert args.driver == 'local'
    assert args.destination == '/some/path'
예제 #11
0
파일: test_cli.py 프로젝트: ss2k18/pgbackup
def test_parser_with_driver_and_destination():
    """
    The parser will not exit if it receives a driver and destination
    """
    parser = cli.create_parser()

    args = parser.parse_args([url, "--driver", "local", "/some/path"])

    assert args.driver == "local"
    assert args.destination == "/some/path"
예제 #12
0
def test_parser_with_known_drivers():
    parser = cli.create_parser()

    for driver in ['local', 's3']:
        assert parser.parse_args([url, '--driver', driver, 'destination'])
예제 #13
0
def test_parser_without_driver():

    with pytest.raises(SystemExit):
        parser = cli.create_parser()
        parser.parse_args([url])
예제 #14
0
def test_parser_with_driver():

    parser = cli.create_parser()
    with pytest.raises(SystemExit):
        parser.parse_args([url, "--driver", "local"])
예제 #15
0
def parser():
    from pgbackup import cli
    return cli.create_parser()
예제 #16
0
def parser():
    return cli.create_parser()
def parser():
    return cli.create_parser()