Skip to content

Commit

Permalink
add create time tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n00rsy committed Apr 5, 2023
1 parent 89c8e61 commit 644ec28
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_task_creator_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def test_current_expiration_is_after(self):
exp = _get_task_expiration(current_exp, None, 60)
assert are_almost_equal(exp, now + timedelta(days=60))

def test_create_date_is_set(self):
now = datetime.utcnow()
current_exp = now + timedelta(days=90)
exp = _get_task_expiration(current_exp, now, 60)
assert are_almost_equal(exp, now + timedelta(days=60))

def test_current_expiration_is_none(self):
now = datetime.utcnow()
exp = _get_task_expiration(None, None, 60)
Expand All @@ -47,3 +53,9 @@ def test_current_expiration_is_after(self):
exp = _get_task_expiration(current_exp.isoformat(), None, 60)
assert are_almost_equal(
to_datetime(exp), now + timedelta(days=60))

def test_create_date_is_set(self):
now = datetime.utcnow()
current_exp = now + timedelta(days=30)
exp = _get_task_expiration(current_exp.isoformat(), now, 60)
assert to_datetime(exp) == current_exp

0 comments on commit 644ec28

Please sign in to comment.