Esempio n. 1
0
 def test_hgt_cm_invalid(self):
     ymin_ymax = (2020, 2030)
     ytest = 2043
     result = year_check(ytest, *ymin_ymax)
     self.assertFalse(
         result,
         "Heights smaller than 150cm or greater than 193cm are invalid.")
Esempio n. 2
0
 def test_eyr_invalid(self):
     ymin_ymax = (2020, 2030)
     ytest = 2043
     result = year_check(ytest, *ymin_ymax)
     self.assertFalse(
         result,
         "Expiration Year shouldn't be valid. Years before 2020 or after 2030 are invalid."
     )
Esempio n. 3
0
 def test_eyr_valid(self):
     ymin_ymax = (2020, 2030)
     ytest = 2025
     result = year_check(ytest, *ymin_ymax)
     self.assertTrue(
         result,
         "Expiration Year shouldn't be invalid. Years in [2020, 2030] are valid."
     )
Esempio n. 4
0
 def test_byr_valid(self):
     ymin_ymax = (1920, 2002)
     ytest = 2002
     result = year_check(ytest, *ymin_ymax)
     self.assertTrue(
         result,
         "Birth Year shouldn't be invalid. Years in [1920, 2002] are valid."
     )
Esempio n. 5
0
 def test_iyr_invalid(self):
     ymin_ymax = (2010, 2020)
     ytest = 2023
     result = year_check(ytest, *ymin_ymax)
     self.assertFalse(
         result,
         "Issue Year shouldn't be valid. Years before 2010 or after 2020 are invalid."
     )
Esempio n. 6
0
 def test_iyr_valid(self):
     ymin_ymax = (2010, 2020)
     ytest = 2014
     result = year_check(ytest, *ymin_ymax)
     self.assertTrue(
         result,
         "Issue Year shouldn't be invalid. Years in [2010, 2020] are valid."
     )
Esempio n. 7
0
 def test_byr_invalid(self):
     ymin_ymax = (1920, 2002)
     ytest = 2003
     result = year_check(ytest, *ymin_ymax)
     self.assertFalse(
         result,
         "Birth Year shouldn't be valid. Years before 1920 or after 2002 are invalid."
     )
Esempio n. 8
0
 def test_fails_year_check(self):
     self.assertFalse(year_check('2003', 1920, 2002))
     self.assertFalse(year_check('2009', 2010, 2020))
Esempio n. 9
0
 def test_passes_year_check(self):
     self.assertTrue(year_check('1980', 1920, 2002))
     self.assertTrue(year_check('2010', 2010, 2020))
     self.assertTrue(year_check('2030', 2020, 2030))