X-Git-Url: https://plomlompom.com/repos//%22https:/validator.w3.org/check?a=blobdiff_plain;f=tests%2Ftest_days.py;h=828e5e895f8a53c6ad71bb65c151721ec6b7a5a7;hb=b16ae56b9c1a5bb799594fdd759a400d40488350;hp=7805208e749a664a655b97103ab3705799e062b1;hpb=4907c8d031ece55f84123293e28648cdc8e9619e;p=plomtask diff --git a/tests/test_days.py b/tests/test_days.py index 7805208..828e5e8 100644 --- a/tests/test_days.py +++ b/tests/test_days.py @@ -9,7 +9,7 @@ class DayTests(TestCase): """Tests for testing the days module.""" def test_Day_dates(self): - """Test Day's date format..""" + """Test Day's date format.""" with self.assertRaises(HandledException): Day('foo') with self.assertRaises(HandledException): @@ -22,6 +22,14 @@ class DayTests(TestCase): Day('2024-02-01 23:00:00') self.assertEqual(datetime(2024, 1, 1), Day('2024-01-01').datetime) + def test_Day_sorting(self): + """Test Day.__lt__.""" + day1 = Day('2024-01-01') + day2 = Day('2024-01-02') + day3 = Day('2024-01-03') + days = [day3, day1, day2] + self.assertEqual(sorted(days), [day1, day2, day3]) + def test_Day_weekday(self): """Test Day.weekday.""" self.assertEqual(Day('2024-03-17').weekday, 'Sunday')