Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jul 24, 2024
1 parent 1002b66 commit 184af5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_60_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,15 @@ def test_expire_cache_entries(
count = clean.expire_cache_entries(tags=tags, before=before, after=after)
assert count == 1
assert now != cached_now()


def test_expire_cache_entries_created_at() -> None:
tic = utils.utcnow()
_ = cached_now()
toc = utils.utcnow()
_ = cached_now()

assert clean.expire_cache_entries(before=tic) == 0
assert clean.expire_cache_entries(after=toc) == 0
assert clean.expire_cache_entries(before=toc) == 1
assert clean.expire_cache_entries(after=tic) == 1

0 comments on commit 184af5d

Please sign in to comment.