def test_get_tags_for_campaigns_invalid(): cids = [999999] tags = placelocal.get_tags_for_campaigns(cids=cids) assert not tags, "Should not have gotten tags for an invalid cid!" with pytest.raises(ValueError): placelocal.get_tags_for_campaigns(cids=None)
def test_get_tags_for_campaigns(): cids = [516675, 509147] tags = placelocal.get_tags_for_campaigns(cids=cids) assert tags, "Did not get tags for cid {}!".format(cids) __validate_tags(tags) for cid in tags: tags_per_campaign = tags[cid] assert len(tags_per_campaign) == 6, "Should have 6 sizes per campaign!" tags_per_size = tags_per_campaign['medium_rectangle'] assert len(tags_per_size) == 2, "Should have 2 tags per size!" iframe_tag = tags_per_size['iframe'] assert iframe_tag, "Should have iframe tag!"
def test_get_tags_for_campaigns(): cids = [516675, 509147] tags, count = placelocal.get_tags_for_campaigns(cids=cids) assert tags, "Did not get tags for cid {}!".format(cids) print "Found {} tags for cid {}.".format(count, cids)