mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-10 20:27:13 +01:00
Pin the clock in the sync-degradation tests; CI ran them inside the early-bird window
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lock-popup-safety (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lock-popup-safety (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c0099dff94
commit
81284f160b
@ -14,6 +14,7 @@ them justifies taking the screen away.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@ -47,12 +48,19 @@ class TestUnreadableSourceIsNotNoWorkout:
|
||||
"early_bird_pending_file": tmp_path / "early_bird_pending.json",
|
||||
}
|
||||
|
||||
# Local noon: outside the 05:00-08:30 early-bird window on any clock. CI
|
||||
# runs around 08:00 UTC, and unpinned that landed inside the window on
|
||||
# the runner, so the chain stopped at "early-bird window open" before it
|
||||
# ever reached the degraded-source verdict these tests are about.
|
||||
_NOON = datetime.now(tz=UTC).astimezone().replace(hour=12, minute=0)
|
||||
|
||||
def test_lock_reports_unreadable_source_not_absent_workout(
|
||||
self, tmp_path: Path
|
||||
) -> None:
|
||||
"""An empty log plus a dead backend must not read as "you did nothing"."""
|
||||
result = explain_lock_decision(
|
||||
**self._files(tmp_path),
|
||||
now=self._NOON,
|
||||
sick_history=SickHistory(),
|
||||
extended_early_bird=False,
|
||||
weekly_minimum_met=False,
|
||||
@ -67,6 +75,7 @@ class TestUnreadableSourceIsNotNoWorkout:
|
||||
"""With every backend answering, an empty log really does mean none."""
|
||||
result = explain_lock_decision(
|
||||
**self._files(tmp_path),
|
||||
now=self._NOON,
|
||||
sick_history=SickHistory(),
|
||||
extended_early_bird=False,
|
||||
weekly_minimum_met=False,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user