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