From 9163f042927eb688a2a93194b2a0f5d4a47a8aca Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Wed, 11 Mar 2020 13:19:40 +0000 Subject: [PATCH] Linting --- moto/iam/models.py | 4 +++- .../test_cloudformation_stack_integration.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/moto/iam/models.py b/moto/iam/models.py index 7ac3a4f9..e34ca7cf 100755 --- a/moto/iam/models.py +++ b/moto/iam/models.py @@ -331,7 +331,9 @@ class Role(BaseModel): cls, resource_name, cloudformation_json, region_name ): properties = cloudformation_json["Properties"] - role_name = properties['RoleName'] if 'RoleName' in properties else str(uuid4())[0:5] + role_name = ( + properties["RoleName"] if "RoleName" in properties else str(uuid4())[0:5] + ) role = iam_backend.create_role( role_name=role_name, diff --git a/tests/test_cloudformation/test_cloudformation_stack_integration.py b/tests/test_cloudformation/test_cloudformation_stack_integration.py index 45a2045b..5a318144 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_integration.py +++ b/tests/test_cloudformation/test_cloudformation_stack_integration.py @@ -918,7 +918,7 @@ def test_iam_roles(): "Principal": {"Service": ["ec2.amazonaws.com"]}, } ] - } + }, }, "Type": "AWS::IAM::Role", }, @@ -940,7 +940,9 @@ def test_iam_roles(): if "my-role" not in role.role_name: role_name_to_id["with-path"] = role.role_id role.path.should.equal("my-path") - len(role.role_name).should.equal(5) # Role name is not specified, so randomly generated - can't check exact name + len(role.role_name).should.equal( + 5 + ) # Role name is not specified, so randomly generated - can't check exact name else: role_name_to_id["no-path"] = role.role_id role.role_name.should.equal("my-role-no-path-name")