]> jfr.im git - yt-dlp.git/blobdiff - test/test_iqiyi_sdk_interpreter.py
[build] Exclude `requests` from `py2exe` (#9982)
[yt-dlp.git] / test / test_iqiyi_sdk_interpreter.py
index 303609baa43085a08fe282cab8e5bba6e3b5ee11..47c632a4e2e51f578b204c1a5bc5c24abafd31d7 100644 (file)
@@ -1,23 +1,18 @@
-#!/usr/bin/env python
-
-from __future__ import unicode_literals
+#!/usr/bin/env python3
 
 # Allow direct execution
 import os
 import sys
 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
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
-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):
+class WarningLogger:
     def __init__(self):
         self.messages = []
 
@@ -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])