def checkRemoteAdset(self): connObj = SocialHelper.getConnObj(newConnection=True) flag = False SocialAdSets = connObj.getAdSets( SocialObject().SocialChannel['facebook'], constant.config['orgId'], 'requestId_automationthriftCall_{}'.format(int(time.time()*1000)) ) for SocialAdSet in SocialAdSets: if SocialAdSet.id == self.remoteAdsetId: flag=True break Assertion.constructAssertion(flag,'SocialAdsetInfo remoteId found in getSocialAdset')
def checkRemoteList(self): connObj = SocialHelper.getConnObj(newConnection=True) flag=False GetCustomAudienceListsResponse = connObj.getCustomAudienceLists( constant.config['orgId'], SocialObject().SocialChannel['facebook'], True, 'requestId_automationthriftCall_{}'.format(int(time.time()*1000)) ) for each in GetCustomAudienceListsResponse.customAudienceLists: if each.remoteListId == self.remoteListId: flag = True break Assertion.constructAssertion(flag,'New Created List with Name :{} found in GetCustomAudienceListsResponse'.format(self.remoteListId))
def setup_method(self, method): self.connObj = SocialHelper.getConnObj(newConnection=True) Logger.logMethodName(method.__name__)