home · contact · privacy
Add date validation for Days.
[plomtask] / tests / test_days.py
index c799f066c7628737afb42a6041786a7af8f1228a..ba627e98cfbfb2c010510f828e965678ba8e783f 100644 (file)
@@ -1,11 +1,20 @@
 """Test days module."""
 from unittest import TestCase
 from plomtask.days import Day
+from plomtask.misc import HandledException
 
 
 class DayTests(TestCase):
     """Tests for testing the days module."""
 
+    def test_Day_dates(self):
+        """Test Day's date format.."""
+        with self.assertRaises(HandledException):
+            Day('foo')
+            Day(None)
+            Day(3)
+            Day('2024-02-30')
+
     def test_Day_weekday(self):
         """Test Day.weekday."""
         self.assertEqual(Day('2024-03-17').weekday, 'Sunday')