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