]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - test/test_playlists.py
[khanacademy] Add support (Fixes #2066)
[youtube-dl.git] / test / test_playlists.py
index 81352de6bb9c09d0aa03ea49fb6d0959475c6523..3229823b692b354db39fd370b90bf9cce63a100b 100644 (file)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
 # encoding: utf-8
 
-
 # Allow direct execution
 import os
 import sys
@@ -29,7 +28,8 @@ from youtube_dl.extractor import (
     SmotriCommunityIE,
     SmotriUserIE,
     IviCompilationIE,
-    ImdbListIE
+    ImdbListIE,
+    KhanAcademyIE,
 )
 
 
@@ -198,6 +198,16 @@ class TestPlaylists(unittest.TestCase):
         self.assertEqual(result['title'], u'Animated and Family Films')
         self.assertTrue(len(result['entries']) >= 48)
 
+    def test_khanacademy_topic(self):
+        dl = FakeYDL()
+        ie = KhanAcademyIE(dl)
+        result = ie.extract('https://www.khanacademy.org/math/applied-math/cryptography')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], u'cryptography')
+        self.assertEqual(result['title'], u'Journey into cryptography')
+        self.assertEqual(result['description'], u'How have humans protected their secret messages through history? What has changed today?')
+        self.assertTrue(len(result['entries']) >= 3)
+
 
 if __name__ == '__main__':
     unittest.main()