Path: blob/develop/tests/unit/customizations/emr/test_assume_role_policy.py
1569 views
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.1213from awscli.testutils import unittest14from awscli.customizations.emr.createdefaultroles import assume_role_policy151617class TestDefaultRoles(unittest.TestCase):18service_principal = "ec2.amazonaws.com"19expected_result = {20"Version": "2008-10-17",21"Statement": [22{23"Sid": "",24"Effect": "Allow",25"Principal": {"Service": "ec2.amazonaws.com"},26"Action": "sts:AssumeRole"27}28]29}3031def test_assume_role_policy(self):32result = assume_role_policy(self.service_principal)33self.assertEqual(result, self.expected_result)343536if __name__ == "__main__":37unittest.main()383940