steam-backlog-enforcer/steam_backlog_enforcer/tests/test_playtime_session.py
Krzysztof kuhy Rudnicki 445ad011bb Remove engagement gating from the gaming budget
A qualifying game process running is now sufficient on its own to bill
the budget. Previously a tick only counted if the screen wasn't locked,
the game's window was X11-focused, and input hadn't gone idle for 5
minutes — with an idle-grace refund on top. That leniency is gone
entirely: no focus check, no idle check, no screen-lock check, no
refund. Deletes the engagement-probing modules (_playtime_engagement,
_engagement_probes, _engagement_types, _x_focus, _x_probe, _screen_hold,
_controller_input) and their config fields, simplifies the audit log
and budget-view/web session schema accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-02 18:14:27 +02:00

22 lines
851 B
Python

"""Tests for building the per-daemon budget session."""
from __future__ import annotations
from steam_backlog_enforcer import _playtime_log as log_mod
from steam_backlog_enforcer._playtime_history import HistoryWriter
from steam_backlog_enforcer._playtime_log import TickJournal
from steam_backlog_enforcer._playtime_session import new_session
class TestNewSession:
def test_builds_a_journal_and_history(self) -> None:
session = new_session()
assert isinstance(session.journal, TickJournal)
assert isinstance(session.history, HistoryWriter)
def test_demo_journals_away_from_the_production_trail(self) -> None:
live = new_session()
demo = new_session(demo=True)
assert demo.journal._log._path == log_mod.BUDGET_DEMO_LOG_FILE
assert live.journal._log._path == log_mod.BUDGET_LOG_FILE