def lookup(self, url): """ Return a Podcast from an iTunes podcast url """ itunes_id = lookup.itunes_id_from_url(url) payload = {'id': itunes_id} r = requests.get("https://itunes.apple.com/lookup", params=payload) r.raise_for_status() podcast = lookup.podcast_from_json(r.text) return podcast
def test_itunes_id_from_url(self): itunes_id = lookup.itunes_id_from_url(lookup_url) self.assertEqual(lookup_id, itunes_id) itunes_id = lookup.itunes_id_from_url(lookup_url2) self.assertEqual(256945396, itunes_id)