示例#1
0
 def test_socialThrift_createAdset_withList_withCouponAttached(
         self, socialStatus):
     adsetName = 'Auto_AdsetName_{}'.format(int(time.time() * 1000))
     SocialOffer = self.connObj.createNativeOffer(
         constant.config['orgId'],
         SocialObject().SocialChannel['facebook'],
         SocialObject.SocialOffer(
             {
                 'offerType': 'percentage_off',
                 'offerText': 'offerText_{}'.format(int(time.time())),
                 'offerValue': 10,
                 'socialOfferCouponsCsvFileInfo': None,
                 'redemptionCode': 'redemptionCode_{}'.format(
                     int(time.time()))
             }, constant.config['facebook']['pageId'],
             SocialObject().OfferLocationType['offline'],
             'overviewDetails_{}'.format(int(time.time())),
             datetime.fromtimestamp(time.time() + 25 * 60 *
                                    60).strftime('%Y-%m-%dT%H:%M:%S'),
             'generic'), 'requestId_automationthriftCall_{}'.format(
                 int(time.time() * 1000)))
     SocialAdsetInfo = self.connObj.createSocialAdset(
         constant.config['orgId'],
         SocialObject().SocialChannel['facebook'],
         SocialObject.SocialAdsetInfo(
             adsetName,
             self.remoteCampaignId,
             datetime.fromtimestamp(
                 time.time()).strftime('%Y-%m-%dT%H:%M:%S'),
             datetime.fromtimestamp(time.time() + 25 * 60 *
                                    60).strftime('%Y-%m-%dT%H:%M:%S'),
             socialStatus,
             100000,
             customAudienceId=self.remoteListId,
             remoteOfferId=SocialOffer.remoteOfferId),
         'requestId_automationthriftCall_{}'.format(int(time.time() *
                                                        1000)))
     SocialHelper.assertCreateAdsetSocial(
         SocialAdsetInfo,
         self.remoteCampaignId,
         SocialObject().SocialStatus[socialStatus.upper()],
         adsetName,
         expectedRemoteListId=self.remoteListId)
示例#2
0
 def test_socialThrift_createAdset_withList_withoutCouponAttached_Sanity(
         self, socialStatus):
     adsetName = 'Auto_AdsetName_{}'.format(int(time.time() * 1000))
     SocialAdsetInfo = self.connObj.createSocialAdset(
         constant.config['orgId'],
         SocialObject().SocialChannel['facebook'],
         SocialObject.SocialAdsetInfo(
             adsetName,
             self.remoteCampaignId,
             datetime.fromtimestamp(
                 time.time()).strftime('%Y-%m-%dT%H:%M:%S'),
             datetime.fromtimestamp(time.time() + 25 * 60 *
                                    60).strftime('%Y-%m-%dT%H:%M:%S'),
             socialStatus,
             100000,
             customAudienceId=self.remoteListId),
         'requestId_automationthriftCall_{}'.format(int(time.time() *
                                                        1000)))
     SocialHelper.assertCreateAdsetSocial(
         SocialAdsetInfo,
         self.remoteCampaignId,
         SocialObject().SocialStatus[socialStatus.upper()],
         adsetName,
         expectedRemoteListId=self.remoteListId)