Back to Black
This commit is contained in:
parent
ea489bce6c
commit
5697ff87a8
112 changed files with 1803 additions and 977 deletions
|
|
@ -616,9 +616,9 @@ def test_ami_describe_executable_users_and_filter():
|
|||
@mock_ec2_deprecated
|
||||
def test_ami_attribute_user_and_group_permissions():
|
||||
"""
|
||||
Boto supports adding/removing both users and groups at the same time.
|
||||
Just spot-check this -- input variations, idempotency, etc are validated
|
||||
via user-specific and group-specific tests above.
|
||||
Boto supports adding/removing both users and groups at the same time.
|
||||
Just spot-check this -- input variations, idempotency, etc are validated
|
||||
via user-specific and group-specific tests above.
|
||||
"""
|
||||
conn = boto.connect_ec2("the_key", "the_secret")
|
||||
reservation = conn.run_instances("ami-1234abcd")
|
||||
|
|
|
|||
|
|
@ -144,7 +144,9 @@ def test_create_flow_log_create():
|
|||
|
||||
bucket = s3.create_bucket(
|
||||
Bucket="test-flow-logs",
|
||||
CreateBucketConfiguration={"LocationConstraint": "us-west-1",},
|
||||
CreateBucketConfiguration={
|
||||
"LocationConstraint": "us-west-1",
|
||||
},
|
||||
)
|
||||
|
||||
response = client.create_flow_logs(
|
||||
|
|
|
|||
|
|
@ -211,16 +211,16 @@ def test_instance_detach_volume_wrong_path():
|
|||
ImageId="ami-d3adb33f",
|
||||
MinCount=1,
|
||||
MaxCount=1,
|
||||
BlockDeviceMappings=[{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 50}},],
|
||||
BlockDeviceMappings=[
|
||||
{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 50}},
|
||||
],
|
||||
)
|
||||
instance = result[0]
|
||||
for volume in instance.volumes.all():
|
||||
with pytest.raises(ClientError) as ex:
|
||||
instance.detach_volume(VolumeId=volume.volume_id, Device="/dev/sdf")
|
||||
|
||||
ex.value.response["Error"]["Code"].should.equal(
|
||||
"InvalidAttachment.NotFound"
|
||||
)
|
||||
ex.value.response["Error"]["Code"].should.equal("InvalidAttachment.NotFound")
|
||||
ex.value.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
|
||||
ex.value.response["Error"]["Message"].should.equal(
|
||||
"The volume {0} is not attached to instance {1} as device {2}".format(
|
||||
|
|
@ -1585,7 +1585,9 @@ def test_create_instance_ebs_optimized():
|
|||
instance.ebs_optimized.should.be(False)
|
||||
|
||||
instance = ec2_resource.create_instances(
|
||||
ImageId="ami-12345678", MaxCount=1, MinCount=1,
|
||||
ImageId="ami-12345678",
|
||||
MaxCount=1,
|
||||
MinCount=1,
|
||||
)[0]
|
||||
instance.load()
|
||||
instance.ebs_optimized.should.be(False)
|
||||
|
|
|
|||
|
|
@ -235,8 +235,8 @@ def test_route_table_associations():
|
|||
@mock_ec2_deprecated
|
||||
def test_route_table_replace_route_table_association():
|
||||
"""
|
||||
Note: Boto has deprecated replace_route_table_association (which returns status)
|
||||
and now uses replace_route_table_association_with_assoc (which returns association ID).
|
||||
Note: Boto has deprecated replace_route_table_association (which returns status)
|
||||
and now uses replace_route_table_association_with_assoc (which returns association ID).
|
||||
"""
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpc = conn.create_vpc("10.0.0.0/16")
|
||||
|
|
|
|||
|
|
@ -661,7 +661,11 @@ def test_run_instances_should_attach_to_default_subnet():
|
|||
client = boto3.client("ec2", region_name="us-west-1")
|
||||
ec2.create_security_group(GroupName="sg01", Description="Test security group sg01")
|
||||
# run_instances
|
||||
instances = client.run_instances(MinCount=1, MaxCount=1, SecurityGroups=["sg01"],)
|
||||
instances = client.run_instances(
|
||||
MinCount=1,
|
||||
MaxCount=1,
|
||||
SecurityGroups=["sg01"],
|
||||
)
|
||||
# Assert subnet is created appropriately
|
||||
subnets = client.describe_subnets()["Subnets"]
|
||||
default_subnet_id = subnets[0]["SubnetId"]
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ def test_create_vpn_connection_with_vpn_gateway():
|
|||
|
||||
vpn_gateway = client.create_vpn_gateway(Type="ipsec.1").get("VpnGateway", {})
|
||||
customer_gateway = client.create_customer_gateway(
|
||||
Type="ipsec.1", PublicIp="205.251.242.54", BgpAsn=65534,
|
||||
Type="ipsec.1",
|
||||
PublicIp="205.251.242.54",
|
||||
BgpAsn=65534,
|
||||
).get("CustomerGateway", {})
|
||||
vpn_connection = client.create_vpn_connection(
|
||||
Type="ipsec.1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue