Add unit testing via pytest (#987)

* Add pytest to project

Includes a couple sample tests, a note in CONTRIBUTING, and inclusion in the makefile

* Include pytest in Travis build
This commit is contained in:
Micah Jerome Ellison 2020-06-20 14:30:15 -07:00 committed by GitHub
parent e4f1453cc9
commit 8d702fee9d
6 changed files with 153 additions and 3 deletions

18
tests/test_time.py Normal file
View file

@ -0,0 +1,18 @@
import datetime
from jrnl import time
def test_default_hour_is_added():
assert time.parse(
"2020-06-20", inclusive=False, default_hour=9, default_minute=0, bracketed=False
) == datetime.datetime(2020, 6, 20, 9)
def test_default_minute_is_added():
assert time.parse(
"2020-06-20",
inclusive=False,
default_hour=0,
default_minute=30,
bracketed=False,
) == datetime.datetime(2020, 6, 20, 0, 30)