From 4907c8d031ece55f84123293e28648cdc8e9619e Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 17 Mar 2024 02:03:33 +0100 Subject: [PATCH] Fix and extend Day date testing. --- tests/test_days.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_days.py b/tests/test_days.py index ba627e9..7805208 100644 --- a/tests/test_days.py +++ b/tests/test_days.py @@ -1,5 +1,6 @@ """Test days module.""" from unittest import TestCase +from datetime import datetime from plomtask.days import Day from plomtask.misc import HandledException @@ -11,9 +12,15 @@ class DayTests(TestCase): """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.""" -- 2.30.2