mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Implement datetime handling in pytest-bdd
- This was awful and convoluted Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
cda07bf8d9
commit
4aabb73847
16 changed files with 133 additions and 87 deletions
22
tests/unit/test_time.py
Normal file
22
tests/unit/test_time.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
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