]> jfr.im git - yt-dlp.git/blobdiff - test/test_netrc.py
[extractor] Add `_perform_login` function (#2943)
[yt-dlp.git] / test / test_netrc.py
index 36b943591711b4c9faad7c58254f4928ab47a95c..94a703406b1000ae09ae78ebc3197f3c2b801b7c 100644 (file)
@@ -7,18 +7,19 @@
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
-from yt_dlp.extractor import (
-    gen_extractors,
-)
+from yt_dlp.extractor import gen_extractor_classes
+from yt_dlp.extractor.common import InfoExtractor
+
+NO_LOGIN = InfoExtractor._perform_login
 
 
 class TestNetRc(unittest.TestCase):
     def test_netrc_present(self):
-        for ie in gen_extractors():
-            if not hasattr(ie, '_login'):
+        for ie in gen_extractor_classes():
+            if ie._perform_login is NO_LOGIN:
                 continue
             self.assertTrue(
-                hasattr(ie, '_NETRC_MACHINE'),
+                ie._NETRC_MACHINE,
                 'Extractor %s supports login, but is missing a _NETRC_MACHINE property' % ie.IE_NAME)