Beispiel #1
0
 def test_get_campaign_by_id(self):
     campaign = Campaign(CampaignTest.conn)
     campaign_info = campaign.get_campaign_by_id(11357, 25270, 77061)
     assert campaign_info is not None
     assert campaign_info.getBudget() > 0
     assert campaign_info.getId() > 0
     assert campaign_info.getName() is not None
Beispiel #2
0
 def test_get_list_by_advertiser(self):
     loader = Campaign(CampaignTest.conn)
     campaigns = loader.get_list_by_advertiser(25270, 11357)
     campaign_ids = []
     for campaign in campaigns:
         campaign_ids.append(campaign.getId())
     assert 77061 in campaign_ids
Beispiel #3
0
 def testGetByCampaign(self):
     
     loader = Campaign(GoalTest.conn)
     campaigns = loader.get_list_by_advertiser(25270, 11357)
     for test_campaign in campaigns:
         loader = Goal(GoalTest.conn)
         goals = loader.get_by_campaign(test_campaign.get('campaignId'), 25270, 11357)
         for goal in goals:
             print goal
Beispiel #4
0
 def testCreate(self):
     campaign = Campaign(CampaignTest.conn)
     campaign['advertiser_id'] = 25270
     campaign['organization_id'] = 11357
     campaign['name'] = "arun's campaign test"
     campaign['startDate'] = "2014-10-17T00:00:00Z"
     campaign['endDate'] = "2015-10-17T00:00:00Z"
     campaign['status'] = "LIVE"
     assert campaign.create() != None
Beispiel #5
0
    def testGetByCampaign(self):

        loader = Campaign(GoalTest.conn)
        campaigns = loader.get_list_by_advertiser(25270, 11357)
        for test_campaign in campaigns:
            loader = Goal(GoalTest.conn)
            goals = loader.get_by_campaign(test_campaign.get('campaignId'),
                                           25270, 11357)
            for goal in goals:
                print goal
Beispiel #6
0
 def test_get_create_url(self):
     campaign_instance = Campaign(CampaignTest.conn)
     assert campaign_instance.get_create_url() == 'https://sandbox.video.advertising.aol.com/peach-rest-api/video-management/v2/organizations/None/advertisers/None/campaigns'
Beispiel #7
0
 def test_get_id(self):
     campaign = Campaign(CampaignTest.conn)
     campaignId = campaign.get_campaign_by_id('11357', '25270', '77061')['campaignId']
     assert campaignId == 77527
Beispiel #8
0
 def testGetByAdvertiser(self):
     loader = Campaign(CampaignTest.conn)
     campaigns = loader.get_list_by_advertiser(25270, 11357)
     assert len(campaigns) >= 1
Beispiel #9
0
 def testGetByCampaignId(self):
     campaign = Campaign(CampaignTest.conn)
     assert campaign.get_campaign_by_id('11357', '25270', '77527') == {u'status': u'LIVE', u'startDate': u'2014-10-17T00:00:00Z', u'endDate': u'2015-10-17T00:00:00Z', u'name': u"arun's campaign test", u'campaignId': 77527, u'organizationId': 11357, u'organizationSapId': 7000077134, u'currencyCode': None, u'advertiserId': 25270, u'customFieldValues': [], u'goals': [], u'advertiserSapId': 0}