]>
Raphaƫl G. Git Repositories - youtubedl/blob - test/test_playlists.py
65de3a55c8694dd764dafa10977448d9274727d2
   7 # Allow direct execution 
   9 sys
.path
.append(os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))) 
  11 from youtube_dl
.extractor 
import DailymotionPlaylistIE
, VimeoChannelIE
 
  12 from youtube_dl
.utils 
import * 
  14 from helper 
import FakeYDL
 
  16 class TestPlaylists(unittest
.TestCase
): 
  17     def assertIsPlaylist(self
, info
): 
  18         """Make sure the info has '_type' set to 'playlist'""" 
  19         self
.assertEqual(info
['_type'], 'playlist') 
  21     def test_dailymotion_playlist(self
): 
  23         ie 
= DailymotionPlaylistIE(dl
) 
  24         result 
= ie
.extract('http://www.dailymotion.com/playlist/xv4bw_nqtv_sport/1#video=xl8v3q') 
  25         self
.assertIsPlaylist(result
) 
  26         self
.assertEqual(result
['title'], u
'SPORT') 
  27         self
.assertTrue(len(result
['entries']) > 20) 
  29     def test_vimeo_channel(self
): 
  31         ie 
= VimeoChannelIE(dl
) 
  32         result 
= ie
.extract('http://vimeo.com/channels/tributes') 
  33         self
.assertIsPlaylist(result
) 
  34         self
.assertEqual(result
['title'], u
'Vimeo Tributes') 
  35         self
.assertTrue(len(result
['entries']) > 24) 
  37 if __name__ 
== '__main__':