aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-07 07:20:20 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-07 07:20:20 +0100
commit059006292523264f4e7c7e03df3729612af8099c (patch)
tree8d1e12c32a966aeb373dd972838febe1d591061d /test/test_utils.py
parent76b3c61012b5cd5a539e2a1a121d11427e6c4c6d (diff)
Respect age_limit when listing extractors (Fixes #4653)
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index dd49a6d17..16e1a1ddf 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -16,6 +16,7 @@ import json
import xml.etree.ElementTree
from youtube_dl.utils import (
+ age_restricted,
args_to_str,
clean_html,
DateRange,
@@ -402,5 +403,12 @@ Trying to open render node...
Success at /dev/dri/renderD128.
ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4')
+ def test_age_restricted(self):
+ self.assertFalse(age_restricted(None, 10)) # unrestricted content
+ self.assertFalse(age_restricted(1, None)) # unrestricted policy
+ self.assertFalse(age_restricted(8, 10))
+ self.assertTrue(age_restricted(18, 14))
+ self.assertFalse(age_restricted(18, 18))
+
if __name__ == '__main__':
unittest.main()