def setUp(self):
        super().setUp()
        global session
        global excluded_resources

        # truncate old data in the table
        if db_utils.check_table_exist(Tables.PM_EXCLUSION_RESOURCES):
            db_utils.delete_table(Tables.PM_EXCLUSION_RESOURCES)

        # create pm_userAttribute table
        mock_pm_exclusionResources.create_table()

        # create record query
        # create resource for check code item 1.22 resource type = "user"
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d541"
        data_pm_exclusion_resources['CheckItemCode'] = check_item_code
        data_pm_exclusion_resources['RegionName'] = region_global
        data_pm_exclusion_resources['ResourceType'] = resource_type_users
        data_pm_exclusion_resources[
            'ResourceName'] = "insightwatch-190611-ContentProtectedReadOnlyPolicy-YDBNQDSP9W1M,PolicyUsers1"
        data_pm_exclusion_resources['OrganizationID'] = organization_id
        data_pm_exclusion_resources['ProjectID'] = project_id
        data_pm_exclusion_resources['AWSAccount'] = aws_account
        data_pm_exclusion_resources['AccountRefineCode'] = account_refine_code
        data_pm_exclusion_resources[
            'CheckItemRefineCode'] = check_item_refine_code
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # create resource for check code item 1.22 resource type = "group"
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d542"
        data_pm_exclusion_resources[
            'ResourceName'] = "insightwatch-190611-ContentProtectedReadOnlyPolicy-YDBNQDSP9W1M,PolicyGroups2"
        data_pm_exclusion_resources['ResourceType'] = resource_type_groups
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # create resource for check code item 1.22 resource type = "role"
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d543"
        data_pm_exclusion_resources[
            'ResourceName'] = "insightwatch-190611-ContentProtectedReadOnlyPolicy-YDBNQDSP9W1M,PolicyRoles3"
        data_pm_exclusion_resources['ResourceType'] = resource_type_roles
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # create resource for check code item other
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d544"
        data_pm_exclusion_resources['CheckItemCode'] = "CHECK_CIS12_ITEM_OTHER"
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # get data excluded resource
        excluded_resources = mock_pm_exclusionResources.query_account_refine_index(
            trace_id, account_refine_code)

        if session is None:
            session = sts_utils.create_session()
    def setUp(self):
        super().setUp()

        global session
        global excluded_resources
        global kms_client_connect
        if not session:
            session = sts_utils.create_session()

        if not kms_client_connect:
            kms_client_connect = kms_utils.client_connect()

        # truncate old data in the table
        if db_utils.check_table_exist(Tables.PM_EXCLUSION_RESOURCES):
            db_utils.delete_table(Tables.PM_EXCLUSION_RESOURCES)

        # create pm_exclusionResources table
        mock_pm_exclusionResources.create_table()

        # create record query
        # create resource for check code item 2.08
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d541"
        data_pm_exclusion_resources['CheckItemCode'] = check_item_code
        data_pm_exclusion_resources['RegionName'] = region_name
        data_pm_exclusion_resources['ResourceType'] = resource_type
        data_pm_exclusion_resources['ResourceName'] = resource_name_test
        data_pm_exclusion_resources['OrganizationID'] = organization_id
        data_pm_exclusion_resources['ProjectID'] = project_id
        data_pm_exclusion_resources['AWSAccount'] = aws_account
        data_pm_exclusion_resources['AccountRefineCode'] = account_refine_code
        data_pm_exclusion_resources[
            'CheckItemRefineCode'] = check_item_refine_code
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # create resource for check code item other
        data_pm_exclusion_resources[
            'ExclusionResourceID'] = "aa4fee9c-790f-478d-9f5d-7aeef688d542"
        data_pm_exclusion_resources['CheckItemCode'] = "CHECK_CIS12_ITEM_OTHER"
        mock_pm_exclusionResources.create(data_pm_exclusion_resources)

        # get data excluded resource
        excluded_resources = mock_pm_exclusionResources.query_account_refine_index(
            trace_id, account_refine_code)