def test_mergeList_LiveCampaign_mobile(self, campaignAndListType, userType, numberOfUsers, customTagCount): mergeListresponse, mergeListPayload, campaignId = campaignList.mergeList( {}, campaignType=campaignAndListType, userType=userType, numberOfUsers=numberOfUsers, numberOfCustomTags=customTagCount) campaignList.assertMergeList(mergeListresponse, 200) groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls( mergeListresponse.get('json').get('entity').get('listId'), mergeListPayload, campaignAndListType[1], expectedTestUsers=mergeListresponse.get('json').get('entity').get( 'recipientsResponse').get('test'), expectedControlUsers=mergeListresponse.get('json').get( 'entity').get('recipientsResponse').get('control')) Logger.log('GroupVersionId : {}, bucketId : {}'.format( groupVersionDetailResult, bucketId)) addRecipientResponse = { 'json': { 'entity': mergeListresponse.get('json').get('entity').get( 'recipientsResponse') } } campaignList.assertAddRecipientDbCalls( addRecipientResponse, mergeListPayload.get('recipients'), mergeListresponse, campaignId, bucketId, { 'TEST': groupVersionDetailResult.get('TEST'), 'CONTROL': groupVersionDetailResult.get('CONTROL') }, userType)
def setup_class(self): Logger.logSuiteName(str(self).split('.')[-1]) nsPort = constant.config['nsMasterPort'] self.nsHelper = NSAdminHelper(constant.config['orgId'], 'SMS') luciPort = constant.config['luciPort'].next() self.luciObj = LuciThrift(luciPort) self.constructObj = LuciObject() constant.config['requestId'] = 'requestId_IRIS_LUCI' createListresponse, createListPayload, campaignId = campaignList.createList({'customTagCount':0, 'name':'IRIS_LIST_' + str(int(time.time() * 100000))}, campaignType=['LIVE', 'ORG', 'List', 'TAGS', 0]) campaignList.assertCreateList(createListresponse, 200) groupVersionDetailResult, bucketId = campaignList.assertCreateListDbCalls(createListresponse['json']['entity']['listId'], createListPayload, 'ORG') Logger.log('GroupVersionId : {}, bucketId : {}'.format(groupVersionDetailResult, bucketId)) addRecipientResponse, addRecipientPayload = campaignList.addRecipient({}, campaignId, createListresponse['json']['entity']['listId'], 'mobile', 10, 0, newUser=False) campaignList.assertAddRecipient(addRecipientResponse, 200) campaignList.assertAddRecipientDbCalls(addRecipientResponse, addRecipientPayload, createListresponse, campaignId, bucketId, {'TEST':groupVersionDetailResult['TEST'], 'CONTROL':groupVersionDetailResult['CONTROL']}, 'mobile') self.bucketId = bucketId self.groupVersionResult = dbCallsList.getGroupVersionDetailsWithGroupId(createListresponse['json']['entity']['listId']) responseCoupon, payloadCoupon, campaignId = coupons.createCoupons(campaignId=campaignId) self.strategy = construct.constructStrategyIds() self.programeId = self.strategy['programeId'] self.allocationStrategyId = self.strategy['allocationStrategyId'] self.expiryStrategyId = self.strategy['expirationStrategyId'] if 'errors' not in responseCoupon['json']: self.voucherId = responseCoupon['json']['entity']['voucherSeriesId'] else: self.voucherId = dbCallsCoupons.getVoucherSeriesIdUsingCampaignId(campaignId) self.campaignId = campaignId self.listId = createListresponse['json']['entity']['listId'] Logger.log('Using CampaignId : {} , listId : {} for Execution of Create Message'.format(self.campaignId, self.listId))