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))
def test_age_restricted_opposite_assertions(self): self.assertTrue(age_restricted(2000, 3000)) self.assertFalse(age_restricted(3000, 2000))
def test_age_restricted_high_ranges(self): self.assertFalse(age_restricted(2000, 3000)) self.assertTrue(age_restricted(3000, 2000))
def test_age_restricted_extreme_ranges(self): self.assertFalse( age_restricted(8, 100000000000000000000000000000000000000000000000)) self.assertTrue( age_restricted(1000000000000000000000000000000000000, 8))
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))
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))