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])
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])
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'])
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"])
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])
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'])
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'])
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'])
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"])
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'
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"
def test_parser_with_known_drivers(): parser = cli.create_parser() for driver in ['local', 's3']: assert parser.parse_args([url, '--driver', driver, 'destination'])
def test_parser_without_driver(): with pytest.raises(SystemExit): parser = cli.create_parser() parser.parse_args([url])
def test_parser_with_driver(): parser = cli.create_parser() with pytest.raises(SystemExit): parser.parse_args([url, "--driver", "local"])
def parser(): from pgbackup import cli return cli.create_parser()
def parser(): return cli.create_parser()