Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
harryfinbow committed Apr 9, 2024
1 parent 037a99a commit d2164a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions runner_manager/models/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from mypy_boto3_ec2.type_defs import (
BlockDeviceMappingTypeDef,
EbsBlockDeviceTypeDef,
IamInstanceProfileTypeDef,
TagSpecificationTypeDef,
TagTypeDef,
IamInstanceProfileTypeDef,
)
from pydantic import BaseModel, BaseSettings

Expand Down Expand Up @@ -187,8 +187,9 @@ def configure_instance(self, runner: Runner) -> AwsInstance:
Tags=tags,
),
]
iam_instance_profile: IamInstanceProfileTypeDef = IamInstanceProfileTypeDef(Name=self.iam_instance_profile_name)

iam_instance_profile: IamInstanceProfileTypeDef = IamInstanceProfileTypeDef(
Name=self.iam_instance_profile_name
)
return AwsInstance(
ImageId=self.image,
InstanceType=self.instance_type,
Expand Down
9 changes: 7 additions & 2 deletions tests/unit/backend/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@ def aws_runner(runner: Runner, aws_group: RunnerGroup) -> Runner:
def test_aws_instance_config(runner: Runner):
AWSConfig()
instance_config = AWSInstanceConfig(
tags={"test": "test"}, subnet_id="i-0f9b0a3b7b3b3b3b3", iam_instance_profile_name = "test"
tags={"test": "test"},
subnet_id="i-0f9b0a3b7b3b3b3b3",
iam_instance_profile_name="test",
)
instance: AwsInstance = instance_config.configure_instance(runner)
assert instance["ImageId"] == instance_config.image
assert instance["SubnetId"] == instance_config.subnet_id
assert instance["IamInstanceProfile"]["Name"] == instance_config.iam_instance_profile_name
assert (
instance["IamInstanceProfile"]["Name"]
== instance_config.iam_instance_profile_name
)
assert runner.name in instance["UserData"]
tags = instance["TagSpecifications"][0]["Tags"]
assert TagTypeDef(Key="test", Value="test") in tags
Expand Down

0 comments on commit d2164a0

Please sign in to comment.