diff --git a/sandbox/__init__.py b/sandbox/__init__.py index 2bd700f..89f75ca 100644 --- a/sandbox/__init__.py +++ b/sandbox/__init__.py @@ -1,2 +1,11 @@ +from datetime import datetime + + def useful_function(): return 42 + + +def is_towel_day(day=None): + if day is None: + day = datetime.today() + return (day.day, day.month) == (25, 5) diff --git a/sandbox/tests/test_towel_day.py b/sandbox/tests/test_towel_day.py new file mode 100644 index 0000000..2563eb9 --- /dev/null +++ b/sandbox/tests/test_towel_day.py @@ -0,0 +1,8 @@ +from datetime import datetime +from sandbox import is_towel_day + + +def test_towel_day(): + assert is_towel_day(datetime(2011, 5, 25)) + assert not is_towel_day(datetime(2011, 6, 25)) + assert not is_towel_day(datetime(2011, 5, 26))