]> jfr.im git - yt-dlp.git/blobdiff - test/test_iqiyi_sdk_interpreter.py
[extractor] Add `_perform_login` function (#2943)
[yt-dlp.git] / test / test_iqiyi_sdk_interpreter.py
index 303609baa43085a08fe282cab8e5bba6e3b5ee11..adbae469030f2e41fd14f6834bb66690c96ee487 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import unicode_literals
 
@@ -8,13 +8,8 @@
 import unittest
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from test.helper import FakeYDL
-from youtube_dlc.extractor import IqiyiIE
-
-
-class IqiyiIEWithCredentials(IqiyiIE):
-    def _get_login_info(self):
-        return 'foo', 'bar'
+from test.helper import FakeYDL, is_download_test
+from yt_dlp.extractor import IqiyiIE
 
 
 class WarningLogger(object):
@@ -31,6 +26,7 @@ def error(self, msg):
         pass
 
 
+@is_download_test
 class TestIqiyiSDKInterpreter(unittest.TestCase):
     def test_iqiyi_sdk_interpreter(self):
         '''
@@ -39,8 +35,8 @@ def test_iqiyi_sdk_interpreter(self):
         If `sign` is incorrect, /validate call throws an HTTP 556 error
         '''
         logger = WarningLogger()
-        ie = IqiyiIEWithCredentials(FakeYDL({'logger': logger}))
-        ie._login()
+        ie = IqiyiIE(FakeYDL({'logger': logger}))
+        ie._perform_login('foo', 'bar')
         self.assertTrue('unable to log in:' in logger.messages[0])