diff options
author | Sergey M․ <[email protected]> | 2014-10-07 22:23:05 +0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2014-10-07 22:23:05 +0700 |
commit | 7bc8780c576505fd87a5c85ff1f50ef2e8841d88 (patch) | |
tree | f129a1d789497f035db3d678796cd03cc5c392e1 /test/test_subtitles.py | |
parent | c59c3c84ede823e5c97f695ae904545c615e4ded (diff) | |
download | youtube-dl-7bc8780c576505fd87a5c85ff1f50ef2e8841d88.tar.gz youtube-dl-7bc8780c576505fd87a5c85ff1f50ef2e8841d88.zip |
[walla] Fix extractor and add subtitle tests
Diffstat (limited to 'test/test_subtitles.py')
-rw-r--r-- | test/test_subtitles.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_subtitles.py b/test/test_subtitles.py index 48c302198..eb5f2f8dd 100644 --- a/test/test_subtitles.py +++ b/test/test_subtitles.py @@ -15,6 +15,7 @@ from youtube_dl.extractor import ( DailymotionIE, TEDIE, VimeoIE, + WallaIE, ) @@ -279,5 +280,32 @@ class TestVimeoSubtitles(BaseTestSubtitles): self.assertTrue(subtitles.get(lang) is not None, u'Subtitles for \'%s\' not extracted' % lang) +class TestWallsSubtitles(BaseTestSubtitles): + url = 'http://vod.walla.co.il/movie/2705958/the-yes-men' + IE = WallaIE + + def test_list_subtitles(self): + self.DL.expect_warning(u'Automatic Captions not supported by this server') + self.DL.params['listsubtitles'] = True + info_dict = self.getInfoDict() + self.assertEqual(info_dict, None) + + def test_allsubtitles(self): + self.DL.expect_warning(u'Automatic Captions not supported by this server') + self.DL.params['writesubtitles'] = True + self.DL.params['allsubtitles'] = True + subtitles = self.getSubtitles() + self.assertEqual(set(subtitles.keys()), set(['heb'])) + self.assertEqual(md5(subtitles['heb']), 'e758c5d7cb982f6bef14f377ec7a3920') + + def test_nosubtitles(self): + self.DL.expect_warning(u'video doesn\'t have subtitles') + self.url = 'http://vod.walla.co.il/movie/2642630/one-direction-all-for-one' + self.DL.params['writesubtitles'] = True + self.DL.params['allsubtitles'] = True + subtitles = self.getSubtitles() + self.assertEqual(len(subtitles), 0) + + if __name__ == '__main__': unittest.main() |