[ted] Fix playlist extraction and add a test
[youtube-dl] / test / test_playlists.py
index 07c85b322afe054f19722eea1855304dbd2d610f..4bd815a0e9694cb0df821cc0e12efed8bd3fc715 100644 (file)
@@ -36,6 +36,7 @@ from youtube_dl.extractor import (
     RutubeChannelIE,
     GoogleSearchIE,
     GenericIE,
+    TEDIE,
 )
 
 
@@ -259,5 +260,14 @@ class TestPlaylists(unittest.TestCase):
         self.assertEqual(result['title'], 'Zero Punctuation')
         self.assertTrue(len(result['entries']) > 10)
 
+    def test_ted_playlist(self):
+        dl = FakeYDL()
+        ie = TEDIE(dl)
+        result = ie.extract('http://www.ted.com/playlists/who_are_the_hackers')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], '10')
+        self.assertEqual(result['title'], 'Who are the hackers?')
+        self.assertTrue(len(result['entries']) >= 6)
+
 if __name__ == '__main__':
     unittest.main()