"""Test days module."""
from unittest import TestCase
+from datetime import datetime
from plomtask.days import Day
from plomtask.misc import HandledException
"""Test Day's date format.."""
with self.assertRaises(HandledException):
Day('foo')
+ with self.assertRaises(HandledException):
Day(None)
+ with self.assertRaises(HandledException):
Day(3)
+ with self.assertRaises(HandledException):
Day('2024-02-30')
+ with self.assertRaises(HandledException):
+ Day('2024-02-01 23:00:00')
+ self.assertEqual(datetime(2024, 1, 1), Day('2024-01-01').datetime)
def test_Day_weekday(self):
"""Test Day.weekday."""