]> jfr.im git - yt-dlp.git/blobdiff - test/test_age_restriction.py
[cleanup] Consistent style for file heads
[yt-dlp.git] / test / test_age_restriction.py
index 71e80b037a5cc99fd0cb1a6711d20cfb59e01b34..ff248432b9ca070151f95816e1e26b0c2daa9023 100644 (file)
@@ -1,15 +1,15 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Allow direct execution
 import os
 import sys
 import unittest
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from test.helper import try_rm
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
-from youtube_dl import YoutubeDL
+from test.helper import is_download_test, try_rm
+from yt_dlp import YoutubeDL
 
 
 def _download_restricted(url, filename, age):
@@ -19,7 +19,7 @@ def _download_restricted(url, filename, age):
         'age_limit': age,
         'skip_download': True,
         'writeinfojson': True,
-        "outtmpl": "%(id)s.%(ext)s",
+        'outtmpl': '%(id)s.%(ext)s',
     }
     ydl = YoutubeDL(params)
     ydl.add_default_info_extractors()
@@ -31,6 +31,7 @@ def _download_restricted(url, filename, age):
     return res
 
 
+@is_download_test
 class TestAgeRestriction(unittest.TestCase):
     def _assert_restricted(self, url, filename, age, old_age=None):
         self.assertTrue(_download_restricted(url, filename, old_age))
@@ -44,11 +45,6 @@ def test_youporn(self):
             'http://www.youporn.com/watch/505835/sex-ed-is-it-safe-to-masturbate-daily/',
             '505835.mp4', 2, old_age=25)
 
-    def test_pornotube(self):
-        self._assert_restricted(
-            'http://pornotube.com/c/173/m/1689755/Marilyn-Monroe-Bathing',
-            '1689755.flv', 13)
-
 
 if __name__ == '__main__':
     unittest.main()