15b3ede3cc
This commit adds a test for a case where an EBS volume has no tags. When an EBS volume has no tags, calls to the aws ec2 endpoints `create_volume` and `describe_volumes` do not include the `Tags` key in the `response.Volumes[]` object. However, moto does include the `Tags` key in this case. This discrepancy in behaviour can result in code passing a moto test but failing in production. Sample snippets that trigger this condition: ``` def create_volume_and_then_get_tags_from_response(): client = boto3.client('ec2', region_name='us-east-1') volume_response = client.create_volume( Size=10, AvailabilityZone='us-east-1a' ) keys = volume_response['Keys'] ``` ``` def create_volume_and_then_get_tags_from_describe_volumes(): client = boto3.client('ec2', region_name='us-east-1') volume_response = client.create_volume( Size=10, AvailabilityZone='us-east-1a' ) volume_describe_response = client.describe_volumes() keys = volume_describe_response['Volumes'][0]['Keys'] ``` Both sample snippets will succeed in a moto test, but fail with a `KeyError` when using the aws api. |
||
---|---|---|
.. | ||
test_account_attributes.py | ||
test_amazon_dev_pay.py | ||
test_amis.py | ||
test_availability_zones_and_regions.py | ||
test_customer_gateways.py | ||
test_dhcp_options.py | ||
test_ec2_core.py | ||
test_elastic_block_store.py | ||
test_elastic_ip_addresses.py | ||
test_elastic_network_interfaces.py | ||
test_general.py | ||
test_instances.py | ||
test_internet_gateways.py | ||
test_ip_addresses.py | ||
test_key_pairs.py | ||
test_monitoring.py | ||
test_nat_gateway.py | ||
test_network_acls.py | ||
test_placement_groups.py | ||
test_regions.py | ||
test_reserved_instances.py | ||
test_route_tables.py | ||
test_security_groups.py | ||
test_server.py | ||
test_spot_fleet.py | ||
test_spot_instances.py | ||
test_subnets.py | ||
test_tags.py | ||
test_utils.py | ||
test_virtual_private_gateways.py | ||
test_vm_export.py | ||
test_vm_import.py | ||
test_vpc_peering.py | ||
test_vpcs.py | ||
test_vpn_connections.py | ||
test_windows.py |