mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-27 21:16:14 +02:00
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:
parent
e4f1453cc9
commit
8d702fee9d
6 changed files with 153 additions and 3 deletions
18
tests/test_time.py
Normal file
18
tests/test_time.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue