@@ -81,16 +81,23 @@ def test_unhappy_invalid_month(self):
8181 def test_unhappy_invalid_years (self ):
8282 with self .assertRaises (ValueError ):
8383 get_date_from_string ("999" )
84+ with self .assertRaises (ValueError ):
8485 get_date_from_string ("06" )
86+ with self .assertRaises (ValueError ):
8587 get_date_from_string ("00" )
88+ with self .assertRaises (ValueError ):
8689 get_date_from_string ("99" )
90+ with self .assertRaises (ValueError ):
8791 get_date_from_string ("9" )
92+ with self .assertRaises (ValueError ):
8893 get_date_from_string ("abc" )
8994
9095 def test_unhappy_blank_values (self ):
9196 with self .assertRaises (ValueError ):
9297 get_date_from_string ("" )
98+ with self .assertRaises (ValueError ):
9399 get_date_from_string (None )
100+ with self .assertRaises (ValueError ):
94101 get_date_from_string (False )
95102
96103
@@ -569,18 +576,23 @@ def test_happy_date(self):
569576 def test_unhappy_string (self ):
570577 with self .assertRaises (ValueError ):
571578 is_today_in_date_range (None , "2023-10-31" )
579+ with self .assertRaises (ValueError ):
572580 is_today_in_date_range ("2023-10-01" , None )
581+ with self .assertRaises (ValueError ):
573582 is_today_in_date_range (None , None )
574583
575584 def test_unhappy_invalid (self ):
576585 with self .assertRaises (ValueError ):
577586 is_today_in_date_range (None , "foo" )
587+ with self .assertRaises (ValueError ):
578588 is_today_in_date_range ("bar" , None )
579589
580590 def test_unhappy_date (self ):
581591 with self .assertRaises (ValueError ):
582592 is_today_in_date_range (None , datetime .date (2023 , 10 , 31 ))
593+ with self .assertRaises (ValueError ):
583594 is_today_in_date_range (datetime .date (2023 , 10 , 31 ), None )
595+ with self .assertRaises (ValueError ):
584596 is_today_in_date_range (None , None )
585597
586598
0 commit comments