def vpc_command(argv=None, aws_config=None): from acli.commands import vpc as command_vpc vpc_res = docopt(command_vpc.__doc__, argv=argv) if any((vpc_res.get('ls'), vpc_res.get('list'))): vpc.vpc_list(aws_config) elif vpc_res.get('info'): vpc.vpc_info(aws_config, vpc_id=vpc_res.get('<vpc_id>'))
def test_vpc_list_service_empty(fake_empty_vpcs, capsys): with pytest.raises(SystemExit): out, err = capsys.readouterr(vpc_list(aws_config=config)) assert err == "No VPCs found."
def test_vpc_list_service(fake_vpcs): with pytest.raises(SystemExit): assert vpc_list(aws_config=config)