test: align savings schema assertions

This commit is contained in:
JerrettDavis 2026-07-15 15:15:24 -05:00
parent e8bff1cfe3
commit d50c73f2a1
3 changed files with 7 additions and 4 deletions

View file

@ -257,7 +257,7 @@ def test_funnel_attributes_savings_from_context_and_stats_exposes_them(tmp_path,
assert stats["persistent_savings"]["projects_limit"] == DEFAULT_MAX_PROJECTS
history = client.get("/stats-history").json()
assert history["schema_version"] == 4
assert history["schema_version"] == 5
assert history["projects"]["ctx-project"]["requests"] == 1

View file

@ -125,7 +125,7 @@ def test_savings_tracker_sanitizes_legacy_state_and_applies_retention(tmp_path):
)
snapshot = tracker.snapshot()
assert snapshot["schema_version"] == 4
assert snapshot["schema_version"] == 5
assert snapshot["lifetime"] == {
"requests": 0,
"tokens_saved": 30,
@ -1100,7 +1100,7 @@ def test_stats_history_persists_across_restarts_and_stats_stays_compatible(tmp_p
history = client.get("/stats-history")
assert history.status_code == 200
history_data = history.json()
assert history_data["schema_version"] == 4
assert history_data["schema_version"] == 5
assert history_data["storage_path"] == str(savings_path)
assert history_data["lifetime"]["tokens_saved"] == 40
assert history_data["lifetime"]["total_input_tokens"] == 120
@ -1659,7 +1659,7 @@ def test_v3_state_without_cache_fields_loads_clean_and_saves_v4(tmp_path):
timestamp="2026-07-02T00:00:00Z",
)
persisted = json.loads(path.read_text(encoding="utf-8"))
assert persisted["schema_version"] == 4
assert persisted["schema_version"] == 5
assert persisted["lifetime"]["cache_read_tokens"] == 5
assert persisted["lifetime"]["tokens_saved"] == 42181

View file

@ -16,6 +16,9 @@ class _FakeSavingsTracker:
def record_request(self, **kwargs: Any) -> None:
pass
def record_lifetime_request(self, **kwargs: Any) -> None:
pass
class _FakeOtelMetrics:
def record_proxy_request(self, **kwargs: Any) -> None: