3 # Allow direct execution
8 sys
.path
.insert(0, os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
))))
11 from test
.helper
import FakeYDL
, is_download_test
12 from yt_dlp
.extractor
import IqiyiIE
19 def warning(self
, msg
):
20 self
.messages
.append(msg
)
30 class TestIqiyiSDKInterpreter(unittest
.TestCase
):
31 def test_iqiyi_sdk_interpreter(self
):
33 Test the functionality of IqiyiSDKInterpreter by trying to log in
35 If `sign` is incorrect, /validate call throws an HTTP 556 error
37 logger
= WarningLogger()
38 ie
= IqiyiIE(FakeYDL({'logger': logger
}))
39 ie
._perform
_login
('foo', 'bar')
40 self
.assertTrue('unable to log in:' in logger
.messages
[0])
43 if __name__
== '__main__':