Address pytest warnings (#3629)
* Address `boto` deprecation warnings This commit eliminates the following warning: ../boto/ec2/connection.py:582: PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations. `boto` isn't likely to ever make good on this warning, but doing the replacement will declutter the `moto` test output. * Remove `invoke_lambda` tracebacks from unit test logging If an exception is encountered, the details are returned in the response payload. Printing the traceback was just adding noise to the pytest output. * Use known AMIs in unit tests This commit eliminates the following warning in the pytest output: `PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.` Known, pre-loaded AMI image ids are used instead of random ids that don't actually exist in the moto backend. The integrity of the tests is unaffected by this change. A test has been added to provide explicit coverage of the PendingDeprecationWarning raised when an invalid AMI image id is passed to moto.
This commit is contained in:
parent
cd25ab7a16
commit
f4b81e69b8
17 changed files with 98 additions and 72 deletions
|
|
@ -1,11 +1,13 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from tests import EXAMPLE_AMI_ID
|
||||
|
||||
template = {
|
||||
"Parameters": {"R53ZoneName": {"Type": "String", "Default": "my_zone"}},
|
||||
"Resources": {
|
||||
"Ec2Instance": {
|
||||
"Type": "AWS::EC2::Instance",
|
||||
"Properties": {"ImageId": "ami-1234abcd", "PrivateIpAddress": "10.0.0.25"},
|
||||
"Properties": {"ImageId": EXAMPLE_AMI_ID, "PrivateIpAddress": "10.0.0.25"},
|
||||
},
|
||||
"HostedZone": {
|
||||
"Type": "AWS::Route53::HostedZone",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from tests import EXAMPLE_AMI_ID, EXAMPLE_AMI_ID2
|
||||
|
||||
template = {
|
||||
"Description": "AWS CloudFormation Sample Template Gollum_Single_Instance_With_EBS_Volume: Gollum is a simple wiki system built on top of Git that powers GitHub Wikis. This template installs a Gollum Wiki stack on a single EC2 instance with an EBS volume for storage and demonstrates using the AWS CloudFormation bootstrap scripts to install the packages and files necessary at instance launch time. **WARNING** This template creates an Amazon EC2 instance and an EBS volume. You will be billed for the AWS resources used if you create a stack from this template.",
|
||||
"Parameters": {
|
||||
|
|
@ -217,43 +219,43 @@ template = {
|
|||
"AWSRegionArch2AMI": {
|
||||
"ap-southeast-1": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-b4b0cae6",
|
||||
"64": "ami-beb0caec",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"ap-southeast-2": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-b3990e89",
|
||||
"64": "ami-bd990e87",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"us-west-2": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-38fe7308",
|
||||
"64": "ami-30fe7300",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"us-east-1": {
|
||||
"64HVM": "ami-0da96764",
|
||||
"32": "ami-31814f58",
|
||||
"64": "ami-1b814f72",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"ap-northeast-1": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-0644f007",
|
||||
"64": "ami-0a44f00b",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"us-west-1": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-11d68a54",
|
||||
"64": "ami-1bd68a5e",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"eu-west-1": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-973b06e3",
|
||||
"64": "ami-953b06e1",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
"sa-east-1": {
|
||||
"64HVM": "NOT_YET_SUPPORTED",
|
||||
"32": "ami-3e3be423",
|
||||
"64": "ami-3c3be421",
|
||||
"32": EXAMPLE_AMI_ID,
|
||||
"64": EXAMPLE_AMI_ID2,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from tests import EXAMPLE_AMI_ID
|
||||
|
||||
template = {
|
||||
"Description": "AWS CloudFormation Sample Template vpc_single_instance_in_subnet.template: Sample template showing how to create a VPC and add an EC2 instance with an Elastic IP address and a security group. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
|
||||
"Parameters": {
|
||||
|
|
@ -263,14 +265,14 @@ template = {
|
|||
},
|
||||
"Mappings": {
|
||||
"RegionMap": {
|
||||
"ap-southeast-1": {"AMI": "ami-74dda626"},
|
||||
"ap-southeast-2": {"AMI": "ami-b3990e89"},
|
||||
"us-west-2": {"AMI": "ami-16fd7026"},
|
||||
"us-east-1": {"AMI": "ami-7f418316"},
|
||||
"ap-northeast-1": {"AMI": "ami-dcfa4edd"},
|
||||
"us-west-1": {"AMI": "ami-951945d0"},
|
||||
"eu-west-1": {"AMI": "ami-24506250"},
|
||||
"sa-east-1": {"AMI": "ami-3e3be423"},
|
||||
"ap-southeast-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
"ap-southeast-2": {"AMI": EXAMPLE_AMI_ID},
|
||||
"us-west-2": {"AMI": EXAMPLE_AMI_ID},
|
||||
"us-east-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
"ap-northeast-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
"us-west-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
"eu-west-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
"sa-east-1": {"AMI": EXAMPLE_AMI_ID},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue