Use known ImageID in internal tests (#3555)

This commit is contained in:
Bert Blommers 2021-01-13 09:02:11 +00:00 committed by GitHub
commit 77dd35e3b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 258 additions and 260 deletions

View file

@ -10,12 +10,14 @@ from botocore.exceptions import ClientError
import sure # noqa
from moto import mock_ec2, mock_iam, mock_cloudformation
from tests import EXAMPLE_AMI_ID
def quick_instance_creation():
image_id = "ami-1234abcd"
conn_ec2 = boto3.resource("ec2", "us-east-1")
test_instance = conn_ec2.create_instances(ImageId=image_id, MinCount=1, MaxCount=1)
test_instance = conn_ec2.create_instances(
ImageId=EXAMPLE_AMI_ID, MinCount=1, MaxCount=1
)
# We only need instance id for this tests
return test_instance[0].id
@ -323,7 +325,7 @@ def test_cloudformation():
"Properties": {
"IamInstanceProfile": {"Ref": "InstanceProfile"},
"KeyName": "mykey1",
"ImageId": "ami-7a11e213",
"ImageId": EXAMPLE_AMI_ID,
},
},
},