screen-locker/screen_locker/tests/test_status_view_part7.py
Krzysztof kuhy Rudnicki 3476dd3afd
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
Split the last 8 test modules; scope pylint's test-inherent checks
Splits test_screen_lock_coverage_part2 via a shared _unlock_helpers.setup_unlock
factory rather than duplicating the fixture, and finishes the remaining
runnerup/manual-workout/status-view test modules under the 250-line cap.

Also splits the pylint hook in two. protected-access, unused-argument and
duplicate-code are how pytest and unit-testing private mixins work, not
defects, and a commit made entirely of test files could never clear the 8.0
batch score with them counted. Source keeps the full rule set — verified that
an injected protected-access is still reported there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EveB813BQ8abAP68VSqZ5Y
2026-08-15 19:40:32 +02:00

38 lines
1.1 KiB
Python

"""Tests for status_view.py: phone-check flow, buttons, main() CLI entry point."""
from __future__ import annotations
from screen_locker.status_view import (
_compliance_state_word,
)
from screen_locker.tests._status_view_helpers import (
_lock_explanation,
_snapshot,
_week,
)
class TestComplianceStateWord:
"""ComplianceStateWord."""
def test_lock_when_fired(self) -> None:
"""Lock when fired."""
snap = _snapshot(lock_explanation=_lock_explanation(fired=True))
assert _compliance_state_word(snap) == "lock"
def test_warn_when_not_fired_but_remaining(self) -> None:
"""Warn when not fired but remaining."""
snap = _snapshot(
lock_explanation=_lock_explanation(fired=False),
week=_week(remaining=2),
)
assert _compliance_state_word(snap) == "warn"
def test_ok_when_not_fired_and_minimum_met(self) -> None:
"""Ok when not fired and minimum met."""
snap = _snapshot(
lock_explanation=_lock_explanation(fired=False),
week=_week(remaining=0),
)
assert _compliance_state_word(snap) == "ok"