コード例 #1
0
 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))
コード例 #2
0
ファイル: test_utils.py プロジェクト: Kyad/youtube-dl
 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))
コード例 #3
0
 def test_age_restricted_opposite_assertions(self):
     self.assertTrue(age_restricted(2000, 3000))
     self.assertFalse(age_restricted(3000, 2000))
コード例 #4
0
 def test_age_restricted_high_ranges(self):
     self.assertFalse(age_restricted(2000, 3000))
     self.assertTrue(age_restricted(3000, 2000))
コード例 #5
0
 def test_age_restricted_extreme_ranges(self):
     self.assertFalse(
         age_restricted(8,
                        100000000000000000000000000000000000000000000000))
     self.assertTrue(
         age_restricted(1000000000000000000000000000000000000, 8))
コード例 #6
0
 def test_age_restricted_normal_ranges(self):
     #The rest of the assertions test other ranges and edge cases.
     self.assertFalse(age_restricted(8, 17))
     self.assertTrue(age_restricted(18, 12))
     self.assertFalse(age_restricted(21, 21))
コード例 #7
0
 def test_age_restricted_unrestricted_ranges(self):
     # This first assertion tests unrestricted content
     self.assertFalse(age_restricted(None, 12))
     #This second assertion tests unrestricted policy
     self.assertFalse(age_restricted(1, None))