예제 #1
0
 def test_parser_invalid_xml(self):
     html = os.path.join(config.data_dir, "test.html")
     podcast = parser.parse(html)
     assert(podcast.error)
예제 #2
0
 def test_parser_invalid_url(self):
     podcast = parser.parse('http://abcd')
     assert(podcast.error)
예제 #3
0
 def test_parser_valid_video_feed(self):
     podcast = parser.parse("tests/data/video-reuters.rss", 'video')
     print(u"Title: {0}".format(podcast.title))
     print("Length: {0}".format(len(podcast.episodes)))
     assert(len(podcast.episodes) == 25)
예제 #4
0
 def test_parser_feed_without_enclosures(self):
     feed = os.path.join(config.data_dir, "invalid-nytimes.xml")
     podcast = parser.parse(feed)
     assert(len(podcast.episodes) == 0)
예제 #5
0
 def test_parser_valid_audio_feed(self):
     feed = os.path.join(config.data_dir, "audio-theguardian.rss")
     self.podcast = parser.parse(feed, 'audio')
     print(u"Title: {0}".format(self.podcast.title))
     print("Length: {0}".format(len(self.podcast.episodes)))
     assert(len(self.podcast.episodes) == 15)