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