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