screen-locker/screen_locker/tests/test_status_data.py
Krzysztof kuhy Rudnicki 02a93f1322 Shutdown +1h on a day with a LeetCode solve; base moves 21:00 -> 20:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 20:06:26 +02:00

26 lines
973 B
Python

"""Tests for the read-only status snapshot layer in _status_data.py."""
from __future__ import annotations
from datetime import UTC, datetime
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pathlib import Path
# Fixed reference instant: Friday 2024-01-05, 12:00 UTC == 13:00 Europe/Warsaw.
# Outside the 05:00-09:00 early-bird window and not a Tue/Wed/Thu relaxed day,
# so lock-decision branches are fully deterministic regardless of wall clock.
_FRIDAY_NOON_UTC = datetime(2024, 1, 5, 12, 0, tzinfo=UTC)
# Monday of that same ISO week, for Mon-Wed shutdown-band assertions.
_MONDAY_NOON_UTC = datetime(2024, 1, 1, 12, 0, tzinfo=UTC)
def _files(tmp_path: Path) -> dict[str, Path]:
return {
"log_file": tmp_path / "log.json",
"extra_benefits_file": tmp_path / "extra_benefits_state.json",
"shutdown_config_file": tmp_path / "shutdown_config.conf",
"early_bird_pending_file": tmp_path / "early_bird_pending.json",
}