mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 18:53:55 +01:00
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
54 lines
1.8 KiB
Python
54 lines
1.8 KiB
Python
"""Tests for the pure, read-only predicates in _compliance_state.py."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from screen_locker import _compliance_state
|
|
|
|
|
|
class TestEarlyBirdWindowOpen:
|
|
"""The early-bird window's start/end boundaries, including the extension."""
|
|
|
|
"""Direct tests for the module-private, deliberately independent reimplementation."""
|
|
|
|
def test_before_window(self) -> None:
|
|
"""Before the start hour the window is shut."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=False, local_minutes=299)
|
|
is False
|
|
)
|
|
|
|
def test_at_start(self) -> None:
|
|
"""The start minute itself is inside the window."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=False, local_minutes=300)
|
|
is True
|
|
)
|
|
|
|
def test_before_end(self) -> None:
|
|
"""A minute before the end is still inside the window."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=False, local_minutes=509)
|
|
is True
|
|
)
|
|
|
|
def test_at_end_exclusive(self) -> None:
|
|
"""The end minute is exclusive: the window is already shut."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=False, local_minutes=510)
|
|
is False
|
|
)
|
|
|
|
def test_extended_before_end(self) -> None:
|
|
"""With the extension earned, the window runs later."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=True, local_minutes=539)
|
|
is True
|
|
)
|
|
|
|
def test_extended_at_end_exclusive(self) -> None:
|
|
"""The extended end is exclusive too."""
|
|
assert (
|
|
_compliance_state._early_bird_window_open(extended=True, local_minutes=540)
|
|
is False
|
|
)
|