Skip to content

test(usage): add missing usage-response.json fixture#10

Merged
deniaud merged 1 commit into
masterfrom
fix/usage-response-test-fixture
May 16, 2026
Merged

test(usage): add missing usage-response.json fixture#10
deniaud merged 1 commit into
masterfrom
fix/usage-response-test-fixture

Conversation

@deniaud

@deniaud deniaud commented May 16, 2026

Copy link
Copy Markdown
Owner

PR #3 (usage-schema-serde-flatten) added a unit test that loads docs/api-samples/usage-response.json via include_str!, but the JSON fixture file was never committed alongside it. cargo test therefore fails with couldn't read ...usage-response.json: No such file or directory.

This PR adds a synthesised JSON sample that satisfies the test's assertions:

  • five_hour.utilization == 22.0
  • seven_day.utilization == 26.0
  • seven_day_sonnet present in .extra
  • seven_day_opus present (null) in .extra

Unblocks cargo test --lib.

The api_usage_response_parses_real_world_sample test in
src/core/segments/usage.rs:431 references docs/api-samples/usage-response.json
via include_str!, but the file was never committed. Add a synthesised sample
satisfying the test's assertions (five_hour.utilization=22.0,
seven_day.utilization=26.0, seven_day_sonnet and seven_day_opus in extras).
@deniaud deniaud merged commit 5b44be9 into master May 16, 2026
3 of 4 checks passed
@deniaud deniaud deleted the fix/usage-response-test-fixture branch May 16, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant