AWS API raises an exception if both AZ and VPCZoneIdentifier params are empty. mock that exception, fix
tests to follow that pattern.
This commit is contained in:
parent
6a29800ec8
commit
59cf81fd56
5 changed files with 137 additions and 62 deletions
17
tests/test_autoscaling/utils.py
Normal file
17
tests/test_autoscaling/utils.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import boto3
|
||||
from moto import mock_ec2
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def setup_networking():
|
||||
ec2 = boto3.resource('ec2', region_name='us-east-1')
|
||||
vpc = ec2.create_vpc(CidrBlock='10.11.0.0/16')
|
||||
subnet1 = ec2.create_subnet(
|
||||
VpcId=vpc.id,
|
||||
CidrBlock='10.11.1.0/24',
|
||||
AvailabilityZone='us-east-1a')
|
||||
subnet2 = ec2.create_subnet(
|
||||
VpcId=vpc.id,
|
||||
CidrBlock='10.11.2.0/24',
|
||||
AvailabilityZone='us-east-1b')
|
||||
return {'vpc': vpc.id, 'subnet1': subnet1.id, 'subnet2': subnet2.id}
|
||||
Loading…
Add table
Add a link
Reference in a new issue