Esempio n. 1
0
    def test_podcast_from_json(self):
        lookup_json = open(lookup_json_file).read()

        cast = Podcast(lookup_id, "NPR: All Songs Considered Podcast",
                       feed_url)
        json_cast = lookup.podcast_from_json(lookup_json)
        self.assertEqual(cast, json_cast)
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
    def test_podcast_from_json(self):
        lookup_json = open(lookup_json_file).read()

        cast = Podcast(lookup_id, "NPR: All Songs Considered Podcast", feed_url)
        json_cast = lookup.podcast_from_json(lookup_json)
        self.assertEqual(cast, json_cast)