test_netrc.py 635 B

123456789101112131415161718192021222324252627
  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import os
  4. import sys
  5. import unittest
  6. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  7. from youtube_dl.extractor import (
  8. gen_extractors,
  9. )
  10. class TestNetRc(unittest.TestCase):
  11. def test_netrc_present(self):
  12. for ie in gen_extractors():
  13. if not hasattr(ie, '_login'):
  14. continue
  15. self.assertTrue(
  16. hasattr(ie, '_NETRC_MACHINE'),
  17. 'Extractor %s supports login, but is missing a _NETRC_MACHINE property' % ie.IE_NAME)
  18. if __name__ == '__main__':
  19. unittest.main()