Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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'])
Exemplo n.º 4
0
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"])
Exemplo n.º 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])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 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'])
Exemplo n.º 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"])
Exemplo n.º 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'
Exemplo n.º 11
0
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"
Exemplo n.º 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'])
Exemplo n.º 13
0
def test_parser_without_driver():

    with pytest.raises(SystemExit):
        parser = cli.create_parser()
        parser.parse_args([url])
Exemplo n.º 14
0
def test_parser_with_driver():

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