示例#1
0
 def test_get_user_name_or_id(self, boto_session):
     session = MagicMock(['client'])
     client = MagicMock(['get_user'])
     session.client.return_value = client
     boto_session.return_value = session
     iam = IAM({})
     iam.client.client.get_user.return_value = {'UserName': '******', 'User': {'UserId': 'id'}}
     self.assertEqual(iam.get_user_name_or_id(), 'name')
示例#2
0
def _get_all_functions(resources_info: Dict):
    arn_list = ResourceGroups(resources_info).get_resource_arn_list(
        IAM(resources_info).get_user_name_or_id())
    return Lambda(resources_info).get_all_functions(arn_list)
示例#3
0
def _get_owner(resources_info: Dict):
    return IAM(resources_info).get_user_name_or_id()
示例#4
0
 def test_init(self):
     ecr = IAM({})
     self.assertEqual(type(ecr.client.client).__name__, "IAM")
示例#5
0
 def iam(self):
     iam = IAM(self.aws_properties)
     return iam