Exemplo n.º 1
0
    def test_campaignShardThrift_reloadFilterBasedList_newBucket_partiallyDistributedBucket(
            self, campaignType, audienceType):
        self.bucketDetails = CampaignShardHelper.updateBucketIdRowCount(
            rows_count=14999990)
        existingList = constant.thiriftCampaignShardTestReferenceObject[
            campaignType]['campaign']['lists'][audienceType][1]
        userPayloadInfo = CampaignShardHelper.loyaltyUserDataConstructHelper()
        s3InfoForUsedList = CampaignShardHelper.getS3Info(existingList['uuid'])

        thriftCampaignGroup = lambda campaignTargetType: self.campaignShardObject.CampaignGroup(
            {
                'campaignId':
                constant.thiriftCampaignShardTestReferenceObject[campaignType][
                    'campaign']['id'],
                'groupId':
                existingList['groupDetails']['id'],
                'groupLabel':
                existingList['groupLabel'],
                'params':
                str(),
                'campaignGroupType':
                'LOYALTY',
                'campaignTargetType':
                'TEST',
                'customerCount':
                existingList['groupVersionDetails'][campaignTargetType][
                    'customer_count'],
                'uuId':
                existingList['uuid'],
                'versionNumber':
                1,
                's3Path':
                s3InfoForUsedList['response']['data']['s3Path'],
                's3Headers':
                s3InfoForUsedList['response']['data']['s3Header'],
                's3BucketTag':
                s3InfoForUsedList['response']['data']['s3Path'].split('/')[2]
            })

        for eachTargetType in ['TEST']:
            if not self.connObj.reloadGroup(
                    thriftCampaignGroup(eachTargetType)):
                Logger.log(
                    'For TargetType :{} , reload was unsuccesfull'.format(
                        eachTargetType))

        CampaignShardHelper.validateBucketIdWhenBucketUpdated(
            existingList['groupDetails']['id'],
            self.bucketDetails['oldBucket'])

        CampaignShardDBAssertion(
            constant.thiriftCampaignShardTestReferenceObject[campaignType]
            ['campaign']['id'], campaignType, 'loyalty',
            existingList['groupLabel'], existingList['groupDetails']['id'],
            'firstName,lastName,mobile', userPayloadInfo).check()
Exemplo n.º 2
0
 def setup_class(self):
     Logger.logSuiteName(str(self).split('.')[-1])
     testControlTypeSupported = ['org', 'skip', 'custom']
     listSupported = ['filter']
     self.campaignShardObject = campaignShardObject()
     self.intialUsedObject = copy.deepcopy(
         constant.thiriftCampaignShardTestReferenceObject)
     CampaignShardHelper.setupCampaignsInThriftReference(
         typesOfCampaign=testControlTypeSupported)
     CampaignShardHelper.setupListInThriftReference(
         listSupported, typesOfCampaign=testControlTypeSupported)
     self.bucketDetails = CampaignShardHelper.updateBucketIdRowCount()