Skip to content

test: expect ApiNotFoundError from account_history on a node without the route - #42

Merged
isaacdoidge merged 1 commit into
masterfrom
fix/history-404-test
Nov 4, 2026
Merged

isaacdoidge merged 1 commit into
masterfrom
fix/history-404-test

Conversation

@isaacdoidge

Copy link
Copy Markdown
Collaborator

What

master fails tests/unit/test_paging.py::AccountHistoryTests::test_a_node_without_the_route_raises_api_error
('Not Found' != ''). The test came from #40, which was written before #35 merged. #35 made ApiError.message the
node's JSON message, falling back to the body text and, for an empty body, the HTTP reason phrase; it also raises
ApiNotFoundError for a 404. Each PR passed on its own.

Changes

  • The test expects what account_history now raises on a node without the /history route (a node before v12):
    ApiNotFoundError with status_code 404 and message "Not Found". Renamed to
    test_a_node_without_the_route_raises_not_found_error.
  • The account_history docstring says the same. It said ApiError with an empty message.

No code change. Every other test that asserts on ApiError still holds with the typed errors.

Checks

make fmt-check, make lint, make typecheck, make test-unit (392 tests, OK, 26 node-backed skipped),
make test-spec (248 scenarios), make build: pass.

🤖 Generated with Claude Code

…the route

A node before v12 has no `/history` route and answers HTTP 404 with an empty
body. `account_history` raises `ApiNotFoundError`, a subclass of `ApiError`,
with `status_code` 404 and the HTTP reason phrase `Not Found` as `message`,
which is what `ApiError.message` holds for an empty body.

The test and the `account_history` docstring now state that.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@isaacdoidge
isaacdoidge merged commit 258a90a into master Nov 4, 2026
5 checks passed
@isaacdoidge
isaacdoidge deleted the fix/history-404-test branch November 4, 2026 01:46
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