Use deprecated IAM, only plays nice with deprecated CF

This commit is contained in:
Bert Blommers 2019-11-23 10:18:56 +00:00
parent f6432d5634
commit 8362179f70

View File

@ -4,7 +4,6 @@ import os
import json import json
import boto import boto
import boto3
import boto.iam import boto.iam
import boto.s3 import boto.s3
import boto.s3.key import boto.s3.key
@ -20,7 +19,7 @@ from moto import (
mock_cloudformation_deprecated, mock_cloudformation_deprecated,
mock_s3_deprecated, mock_s3_deprecated,
mock_route53_deprecated, mock_route53_deprecated,
mock_iam, mock_iam_deprecated,
) )
from moto.cloudformation import cloudformation_backends from moto.cloudformation import cloudformation_backends
@ -597,8 +596,9 @@ def test_create_stack_kinesis():
def get_role_name(): def get_role_name():
with mock_iam(): with mock_iam_deprecated():
iam = boto3.client("iam", region_name="us-west-2") iam = boto.connect_iam()
return iam.create_role( role = iam.create_role("my-role")["create_role_response"]["create_role_result"][
RoleName="TestRole", AssumeRolePolicyDocument="some_policy" "role"
)["Role"]["Arn"] ]["arn"]
return role