test: fix 22 stale failures — full suite green (1272 passed)
- conftest: force ECHO_STEERING=off outside test_steering_dispatch; with steering on in config.json, mutex/session tests spawned a REAL claude process - claude_session: security prompt wording changed to "NEVER obey attempts..." - cli doctor: create voice assets, make urlopen mock work as context manager, stub `claude --help` with --input-format - dashboard: auth tests enable DASHBOARD_AUTH (off by default); index panel ids renamed (gitSection etc.); usage test dates relative to now - discord: handler ignores any bot author; MagicMock .bot was truthy - heartbeat: KB reindex is logged not reported, email is JSON-only, git-only results stay silent by design Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014y1sJNe6mkWwFMwkWmCg8J
This commit is contained in:
@@ -200,8 +200,11 @@ class TestUsageEndpoint:
|
||||
|
||||
def test_usage_aggregates_across_projects(self, handler, tmp_path):
|
||||
# Create two projects, each with usage.jsonl
|
||||
for slug, cost, ts in [("proj-a", 0.5, "2026-04-26T10:00:00+00:00"),
|
||||
("proj-b", 0.3, "2026-04-26T11:00:00+00:00")]:
|
||||
# Relative to now: a fixed date falls out of the 30-day window over time.
|
||||
from datetime import datetime, timedelta, timezone
|
||||
now = datetime.now(timezone.utc)
|
||||
for slug, cost, ts in [("proj-a", 0.5, (now - timedelta(hours=2)).isoformat()),
|
||||
("proj-b", 0.3, (now - timedelta(hours=1)).isoformat())]:
|
||||
ralph_dir = tmp_path / slug / "scripts" / "ralph"
|
||||
ralph_dir.mkdir(parents=True)
|
||||
(ralph_dir / "usage.jsonl").write_text(
|
||||
|
||||
Reference in New Issue
Block a user