From 184af5dcf8540a78b3ab0c339181906b655121a0 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Wed, 24 Jul 2024 16:10:52 +0200 Subject: [PATCH] add test --- tests/test_60_clean.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_60_clean.py b/tests/test_60_clean.py index 32f1b8c..c27a8f4 100644 --- a/tests/test_60_clean.py +++ b/tests/test_60_clean.py @@ -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