Evita baseline completa del watchdog
This commit is contained in:
17
tests/test_watcher.py
Normal file
17
tests/test_watcher.py
Normal 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)
|
||||
Reference in New Issue
Block a user