mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-11 19:13:49 +01:00
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>
22 lines
851 B
Python
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
|