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

@ -5,6 +5,7 @@ import sure # noqa
from moto import mock_ec2
from moto.core import ACCOUNT_ID
from tests import EXAMPLE_AMI_ID
def get_subnet_id(conn):
@ -24,7 +25,7 @@ def spot_config(subnet_id, allocation_strategy="lowestPrice"):
"IamFleetRole": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID),
"LaunchSpecifications": [
{
"ImageId": "ami-123",
"ImageId": EXAMPLE_AMI_ID,
"KeyName": "my-key",
"SecurityGroups": [{"GroupId": "sg-123"}],
"UserData": "some user data",
@ -54,7 +55,7 @@ def spot_config(subnet_id, allocation_strategy="lowestPrice"):
"SpotPrice": "0.13",
},
{
"ImageId": "ami-123",
"ImageId": EXAMPLE_AMI_ID,
"KeyName": "my-key",
"SecurityGroups": [{"GroupId": "sg-123"}],
"UserData": "some user data",
@ -108,7 +109,7 @@ def test_create_spot_fleet_with_lowest_price():
launch_spec["IamInstanceProfile"].should.equal(
{"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)}
)
launch_spec["ImageId"].should.equal("ami-123")
launch_spec["ImageId"].should.equal(EXAMPLE_AMI_ID)
launch_spec["InstanceType"].should.equal("t2.small")
launch_spec["KeyName"].should.equal("my-key")
launch_spec["Monitoring"].should.equal({"Enabled": True})