mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-10 20:27:13 +01:00
Fix CI-only failure: avoid dating a test entry "today" without HMAC
has_logged_today treats an unsigned today-dated entry as "logged" only when no HMAC key is configured on the machine (CI has none; this dev box has a real key), so the test's precondition diverged between environments. Reach the new weekly minimum via Jan 1-4 instead of adding a same-day entry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
298daf028d
commit
9172b1ec8a
@ -156,18 +156,20 @@ class TestGatherStatus:
|
||||
assert snap.lock_explanation.stage == "relaxed_day"
|
||||
|
||||
def test_weekly_minimum_met_stops_lock(self, tmp_path: Path) -> None:
|
||||
# Avoid dating anything "today" (2024-01-05): an unsigned today entry
|
||||
# trips already_logged before weekly_minimum_met, and does so only
|
||||
# when no HMAC key is configured (env-dependent) -- Jan 4 holds two.
|
||||
files = _files(tmp_path)
|
||||
files["log_file"].write_text(
|
||||
json.dumps(
|
||||
{
|
||||
d: {"workout_data": {"type": "phone_verified"}}
|
||||
for d in (
|
||||
"2024-01-01",
|
||||
"2024-01-02",
|
||||
"2024-01-03",
|
||||
"2024-01-04",
|
||||
"2024-01-05",
|
||||
)
|
||||
"2024-01-01": {"workout_data": {"type": "phone_verified"}},
|
||||
"2024-01-02": {"workout_data": {"type": "phone_verified"}},
|
||||
"2024-01-03": {"workout_data": {"type": "phone_verified"}},
|
||||
"2024-01-04": [
|
||||
{"workout_data": {"type": "phone_verified"}},
|
||||
{"workout_data": {"type": "phone_verified"}},
|
||||
],
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user