예제 #1
0
 def test_socialThrift_createCustomList_withSameIdMultipleTimes(
         self, numberOfUsers, identifier, listName, description, channel,
         testControlType):
     groupVersionid, groupName = SocialHelper.createListForSocial(
         self.campaigns, testControlType)
     messageId = SocialHelper.createMessageForThriftHelp(
         self.campaigns[testControlType], groupVersionid, numberOfUsers,
         groupName)
     listName = listName.format(identifier, testControlType,
                                int(time.time() * 1000))
     preCreatedListId = None
     for _ in range(2):
         CreateCustomAudienceListResponse = self.connObj.createCustomList(
             SocialHelper.createUserListObject(numberOfUsers, identifier),
             SocialObject.CustomAudienceListDetails(listName, description,
                                                    messageId),
             SocialObject.SocialAccountDetails(channel),
             constant.config['orgId'], str(groupVersionid),
             'requestId_automationthriftCall_{}'.format(
                 int(time.time() * 1000)))
         SocialHelper.assertCreateCustomList(
             groupVersionid, messageId, CreateCustomAudienceListResponse,
             listName, description)
         if preCreatedListId is None:
             preCreatedListId = CreateCustomAudienceListResponse.listid
         else:
             SocialHelper.assertRemoteListIds(
                 preCreatedListId, CreateCustomAudienceListResponse.listid)
예제 #2
0
 def setup_class(self):
     self.numberOfUsers = 20
     self.constructObj = LuciObject()
     self.DracarysObj = DracarysObject()
     self.DracraysConnObj = DracarysHelper.getConnObj(newConnection=True)
     self.campaigns = SocialHelper.createCampaignsForSocialThrift(
         testControlType=['ORG'])
     self.groupVersionid, self.groupName = SocialHelper.createListForSocial(
         self.campaigns,
         'ORG',
         numberOfUsers=self.numberOfUsers,
         newUser=True)
     self.remoteCampaignId = SocialHelper.createRemoteCampaignsForSocialThrift(
         self.campaigns['ORG'])
     SocialHelper.updateRemoteCampaignIdInCampaignsBase(
         self.campaigns['ORG'], self.remoteCampaignId)
     self.voucherSeriesId = coupons.createCoupons(
         campaignId=self.campaigns['ORG'],
         payloadData={
             'couponLimit': {
                 'limit': 0,
                 'type': 'UNLIMITED'
             },
             'discountOn': 'BILL',
             'discountType': 'ABS',
             'discountValue': 10
         })[0]['json']['entity']['voucherSeriesId']
     SocialHelper.couponConfigChange(
         {
             'client_handling_type': 'EXTERNAL_ISSUAL',
             'any_user': True
         }, self.campaigns['ORG'], self.voucherSeriesId)
예제 #3
0
    def test_socialThrift_integrateOfCreateAndGetList(self, numberOfUsers,
                                                      identifier, listName,
                                                      description, channel,
                                                      testControlType):
        groupVersionid, groupName = SocialHelper.createListForSocial(
            self.campaigns, testControlType)
        messageId = SocialHelper.createMessageForThriftHelp(
            self.campaigns[testControlType], groupVersionid, numberOfUsers,
            groupName)
        listName = listName.format(identifier, testControlType,
                                   int(time.time() * 1000))
        CreateCustomAudienceListResponse = self.connObj.createCustomList(
            SocialHelper.createUserListObject(numberOfUsers, identifier),
            SocialObject.CustomAudienceListDetails(listName, description,
                                                   messageId),
            SocialObject.SocialAccountDetails(channel),
            constant.config['orgId'],
            str(groupVersionid), 'requestId_automationthriftCall_{}'.format(
                int(time.time() * 1000)))
        Logger.log('Create Audience List , Response Message :{}'.format(
            CreateCustomAudienceListResponse.message))

        GetCustomAudienceListsResponse = self.connObj.getCustomAudienceLists(
            constant.config['orgId'],
            SocialObject().SocialChannel['facebook'],
            True, 'requestId_automationthriftCall_{}'.format(
                int(time.time() * 1000)))
        Logger.log('Message From Get Custom Audience List : {}'.format(
            GetCustomAudienceListsResponse.message))
        SocialHelper.assertNewCreatedListInGetCall(
            listName, GetCustomAudienceListsResponse)
예제 #4
0
	def setup_class(self):
		self.numberOfUsers = 20
		self.campaigns = SocialHelper.createCampaignsForSocialThrift(testControlType=['CUSTOM'])
		self.groupVersionid,self.groupName = SocialHelper.createListForSocial(self.campaigns,'CUSTOM',numberOfUsers=self.numberOfUsers,newUser=True)
		self.remoteCampaignId = SocialHelper.createRemoteCampaignsForSocialThrift(self.campaigns['CUSTOM'])
		SocialHelper.updateRemoteCampaignIdInCampaignsBase(self.campaigns['CUSTOM'],self.remoteCampaignId)
		self.voucherSeriesId = coupons.createCoupons(campaignId=self.campaigns['CUSTOM'],payloadData={'couponLimit':{'limit':0, 'type':'UNLIMITED'}, 'discountOn':'BILL', 'discountType':'ABS', 'discountValue':10})[0]['json']['entity']['voucherSeriesId']
예제 #5
0
 def test_socialThrift_createCustomList_WithDifferentTestControlType(
         self, numberOfUsers, identifier, listName, description, channel,
         testControlType):
     groupVersionid, groupName = SocialHelper.createListForSocial(
         self.campaigns, testControlType)
     messageId = SocialHelper.createMessageForThriftHelp(
         self.campaigns[testControlType], groupVersionid, numberOfUsers,
         groupName)
     listName = listName.format(identifier, testControlType,
                                int(time.time() * 1000))
     CreateCustomAudienceListResponse = self.connObj.createCustomList(
         SocialHelper.createUserListObject(numberOfUsers, identifier),
         SocialObject.CustomAudienceListDetails(listName, description,
                                                messageId),
         SocialObject.SocialAccountDetails(channel),
         constant.config['orgId'],
         str(groupVersionid), 'requestId_automationthriftCall_{}'.format(
             int(time.time() * 1000)))
     Logger.log('Create Audience List , Response Message :{}'.format(
         CreateCustomAudienceListResponse.message))
     SocialHelper.assertCreateCustomList(groupVersionid, messageId,
                                         CreateCustomAudienceListResponse,
                                         listName, description)