]> jfr.im git - yt-dlp.git/blob - test/test_netrc.py
[extractor] Add `_perform_login` function (#2943)
[yt-dlp.git] / test / test_netrc.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import os
5 import sys
6 import unittest
7 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
9
10 from yt_dlp.extractor import gen_extractor_classes
11 from yt_dlp.extractor.common import InfoExtractor
12
13 NO_LOGIN = InfoExtractor._perform_login
14
15
16 class TestNetRc(unittest.TestCase):
17 def test_netrc_present(self):
18 for ie in gen_extractor_classes():
19 if ie._perform_login is NO_LOGIN:
20 continue
21 self.assertTrue(
22 ie._NETRC_MACHINE,
23 'Extractor %s supports login, but is missing a _NETRC_MACHINE property' % ie.IE_NAME)
24
25
26 if __name__ == '__main__':
27 unittest.main()