def test_socialThrift_getAdset_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)))

        SocialAdSets = self.connObj.getAdSets(
            SocialObject().SocialChannel['facebook'], constant.config['orgId'],
            'requestId_automationthriftCall_{}'.format(int(time.time() *
                                                           1000)))

        SocialHelper.assertGetAdset(SocialAdSets, SocialAdsetInfo,
                                    SocialObject().SocialStatus[socialStatus])
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)