home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add date validation for Days.
[plomtask]
/
tests
/
test_days.py
diff --git
a/tests/test_days.py
b/tests/test_days.py
index c799f066c7628737afb42a6041786a7af8f1228a..ba627e98cfbfb2c010510f828e965678ba8e783f 100644
(file)
--- a/
tests/test_days.py
+++ b/
tests/test_days.py
@@
-1,11
+1,20
@@
"""Test days module."""
from unittest import TestCase
from plomtask.days import Day
"""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."""
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')
def test_Day_weekday(self):
"""Test Day.weekday."""
self.assertEqual(Day('2024-03-17').weekday, 'Sunday')