diff options
author | Ismael Mejia <iemejia@gmail.com> | 2013-08-22 23:29:36 +0200 |
---|---|---|
committer | Ismael Mejia <iemejia@gmail.com> | 2013-08-22 23:29:36 +0200 |
commit | 18b4e04f1c663e0ea695f6501b860f85af9d7ca1 (patch) | |
tree | d60ebbf51b8c50f808c6c251fc6c02547052a9dc /test/test_playlists.py | |
parent | d80a064eff4fe2416f9db36b07f1e2ca641f1334 (diff) | |
parent | 1865ed31b955795f9859df5c1c400d172ae9a28a (diff) |
Merge branch 'master' into subtitles_rework
Diffstat (limited to 'test/test_playlists.py')
-rw-r--r-- | test/test_playlists.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/test_playlists.py b/test/test_playlists.py new file mode 100644 index 000000000..65de3a55c --- /dev/null +++ b/test/test_playlists.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +import sys +import unittest +import json + +# Allow direct execution +import os +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from youtube_dl.extractor import DailymotionPlaylistIE, VimeoChannelIE +from youtube_dl.utils import * + +from helper import FakeYDL + +class TestPlaylists(unittest.TestCase): + def assertIsPlaylist(self, info): + """Make sure the info has '_type' set to 'playlist'""" + self.assertEqual(info['_type'], 'playlist') + + def test_dailymotion_playlist(self): + dl = FakeYDL() + ie = DailymotionPlaylistIE(dl) + result = ie.extract('http://www.dailymotion.com/playlist/xv4bw_nqtv_sport/1#video=xl8v3q') + self.assertIsPlaylist(result) + self.assertEqual(result['title'], u'SPORT') + self.assertTrue(len(result['entries']) > 20) + + def test_vimeo_channel(self): + dl = FakeYDL() + ie = VimeoChannelIE(dl) + result = ie.extract('http://vimeo.com/channels/tributes') + self.assertIsPlaylist(result) + self.assertEqual(result['title'], u'Vimeo Tributes') + self.assertTrue(len(result['entries']) > 24) + +if __name__ == '__main__': + unittest.main() |