Evita baseline completa del watchdog

This commit is contained in:
2026-07-02 10:05:18 +02:00
parent 2f0a5d53cf
commit 7b609a8d65
7 changed files with 62 additions and 16 deletions

17
tests/test_watcher.py Normal file
View File

@@ -0,0 +1,17 @@
from __future__ import annotations
import time
from bakrest.watcher import _mtime_is_recent
def test_mtime_is_recent_rejects_old_timestamps() -> None:
old_mtime_ns = int((time.time() - 3600) * 1_000_000_000)
assert not _mtime_is_recent(old_mtime_ns, 300)
def test_mtime_is_recent_accepts_recent_timestamps() -> None:
recent_mtime_ns = int(time.time() * 1_000_000_000)
assert _mtime_is_recent(recent_mtime_ns, 300)