コード例 #1
0
ファイル: test_parser.py プロジェクト: joshgoss/pinto
 def test_parser_invalid_xml(self):
     html = os.path.join(config.data_dir, "test.html")
     podcast = parser.parse(html)
     assert(podcast.error)
コード例 #2
0
ファイル: test_parser.py プロジェクト: joshgoss/pinto
 def test_parser_invalid_url(self):
     podcast = parser.parse('http://abcd')
     assert(podcast.error)
コード例 #3
0
ファイル: test_parser.py プロジェクト: joshgoss/pinto
 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
ファイル: test_parser.py プロジェクト: joshgoss/pinto
 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
ファイル: test_parser.py プロジェクト: joshgoss/pinto
 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)