Example #1
0
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>'))
Example #2
0
def test_vpc_info_service_empty(fake_empty_vpcs, capsys):
    with pytest.raises(SystemExit):
        invalid_vpc_id = 'invalid'
        out, err = capsys.readouterr(
            vpc_info(aws_config=config, vpc_id=invalid_vpc_id))
        assert err == "Cannot find VPC: {0}".format(invalid_vpc_id)
Example #3
0
def test_vpc_info_service_empty(fake_empty_vpcs, capsys):
    with pytest.raises(SystemExit):
        invalid_vpc_id = 'invalid'
        out, err = capsys.readouterr(vpc_info(aws_config=config, vpc_id=invalid_vpc_id))
        assert err == "Cannot find VPC: {0}".format(invalid_vpc_id)
Example #4
0
def test_vpc_info_service(fake_vpcs):
    with pytest.raises(SystemExit):
        vpc_info(aws_config=config,
                 vpc_id=fake_vpcs.get('Vpcs')[0].get('VpcId'))
        assert vpc_info(aws_config=config,
                        vpc_id=fake_vpcs.get('Vpcs')[0].get('VpcId'))
Example #5
0
def test_vpc_info_service(fake_vpcs):
    with pytest.raises(SystemExit):
        vpc_info(aws_config=config, vpc_id=fake_vpcs.get('Vpcs')[0].get('VpcId'))
        assert vpc_info(aws_config=config, vpc_id=fake_vpcs.get('Vpcs')[0].get('VpcId'))