]> jfr.im git - yt-dlp.git/blame - test/test_netrc.py
Make sure netrc works for all extractors with login support
[yt-dlp.git] / test / test_netrc.py
CommitLineData
499bfcbf
PH
1# coding: utf-8
2from __future__ import unicode_literals
3
4import os
5import sys
6import unittest
7sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
9
10from youtube_dl.extractor import (
11 gen_extractors,
12)
13
14
15class TestNetRc(unittest.TestCase):
16 def test_netrc_present(self):
17 for ie in gen_extractors():
18 if not hasattr(ie, '_login'):
19 continue
20 self.assertTrue(
21 hasattr(ie, '_NETRC_MACHINE'),
22 'Extractor %s supports login, but is missing a _NETRC_MACHINE property' % ie.IE_NAME)
23
24
25if __name__ == '__main__':
26 unittest.main()