def test_show_direct_videos(self): items = show_videos('760-rubymidwest2011-mastering-the-ruby-debugger') # 'Mastering the Ruby Debugger' has multiple direct videos self.assertEqual(len(items), 4) self.assertEqual(items[0], { 'is_playable': True, 'label': '1920x1080 - - application/x-mp4 - 1.2 GB - 00:34:05', 'path': 'http://cdn.confreaks.com/system/assets/datas/2930/original/d2-01-mastering-the-ruby-debugger.mp4?1326174735' }) self.assertEqual(items[1], { 'is_playable': True, 'label': '1280x720 - application/x-mp4 - 153.3 MB - 00:34:05', 'path': 'http://cdn.confreaks.com/system/assets/datas/2959/original/760-rubymidwest2011-mastering-the-ruby-debugger-large.mp4?1326186609' }) self.assertEqual(items[2], { 'is_playable': True, 'label': '640x360 - - application/x-mp4 - 62.8 MB - 00:34:05', 'path': 'http://cdn.confreaks.com/system/assets/datas/2958/original/760-rubymidwest2011-mastering-the-ruby-debugger-small.mp4?1326186603' }) self.assertEqual(items[3], { 'is_playable': True, 'label': 'application/x-mp3 - 16.4 MB - 00:34:05', 'path': 'http://cdn.confreaks.com/system/assets/datas/2960/original/760-rubymidwest2011-mastering-the-ruby-debugger.mp3?1326186611' })
def test_show_vimeo_videos(self): items = show_videos('webrebels2012') self.assertTrue(len(items) == 17) self.assertEqual([v for v in items if "Dave Herman" in v['label']][0], { 'is_playable': True, 'label': 'The JavaScript Virtual Machine [COLOR mediumslateblue]Dave Herman[/COLOR]', 'path': 'plugin://plugin.video.vimeo/?action=play_video&videoid=43380479' })
def test_show_youtube_videos(self): items = show_videos('arrrrcamp2013') self.assertEqual(len(items), 22) self.assertEqual([v for v in items if "Avdi Grimm" in v['label']][0], { 'is_playable': True, 'label': u'You gotta try this [COLOR mediumslateblue]Avdi Grimm[/COLOR]', 'path': 'plugin://plugin.video.youtube/?action=play_video&videoid=sVd4p6oKeUA' })
def test_show_vimeo_videos(self): items = show_videos('2150-webrebels2012-application-cache-douchebag') # 'Application Cache Douchebag' has a Vimeo video self.assertEqual(len(items), 1) self.assertEqual(items[0], { 'is_playable': True, 'label': 'Vimeo Video', 'path': 'plugin://plugin.video.vimeo/?action=play_video&videoid=43336762' })
def test_show_youtube_videos(self): items = show_videos('2701-arrrrcamp2013-you-gotta-try-this') # 'You gotta try this' has a YouTube video self.assertEqual(len(items), 1) self.assertEqual(items[0], { 'is_playable': True, 'label': 'YouTube Video', 'path': 'plugin://plugin.video.youtube/?action=play_video&videoid=sVd4p6oKeUA' })