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)
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)
def createRemoteListForSocialThrift(campaigns): groupVersionid, groupName = SocialHelper.createListForSocial( campaigns, 'ORG') messageId = SocialHelper.createMessageForThriftHelp( campaigns['ORG'], groupVersionid, 5, groupName) connObj = SocialHelper.getConnObj(newConnection=True) return connObj.createCustomList( SocialHelper.createUserListObject(5), SocialObject.CustomAudienceListDetails( 'remoteList_testAdset_{}'.format(int(time.time())), 'Test Create Adset', messageId), SocialObject.SocialAccountDetails('facebook'), constant.config['orgId'], str(groupVersionid), 'requestId_automationthriftCall_{}'.format( int(time.time() * 1000))).listid, groupVersionid
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)