def test_ec2_instance_with_role(ec2_instance_with_role, iam_role_arn, region):
    from handler_ec2_role import handle
    result: Dict = handle({'instanceId': ec2_instance_with_role, 'region': region}, LambdaTestContext('foobar', env={}, custom={}))
    assert (result.get('result').get('roleName') == iam_role_arn[1].get('Name'))
    assert (str.split(result.get('result').get('roleArn'), ':role/') == str.split(iam_role_arn[1].get('Arn'), ':instance-profile/'))
def test_ec2_instance_with_role(ec2_instance_with_role, iam_role_arn, region):
    from handler_ec2_role import handle
    result: Dict = handle({'instanceId': ec2_instance_with_role, 'region': region}, LambdaTestContext('foobar', env={}, custom={}))
    assert (result.get('result').get('roleName') == iam_role_arn[1].get('Name'))
    assert (str.split(result.get('result').get('roleArn'), ':role/') == str.split(iam_role_arn[1].get('Arn'), ':instance-profile/'))