Repository navigation
test: expect ApiNotFoundError from account_history on a node without the route - #42
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
masterfailstests/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 madeApiError.messagethenode's JSON
message, falling back to the body text and, for an empty body, the HTTP reason phrase; it also raisesApiNotFoundErrorfor a 404. Each PR passed on its own.Changes
account_historynow raises on a node without the/historyroute (a node before v12):ApiNotFoundErrorwithstatus_code404 andmessage"Not Found". Renamed totest_a_node_without_the_route_raises_not_found_error.account_historydocstring says the same. It saidApiErrorwith an emptymessage.No code change. Every other test that asserts on
ApiErrorstill 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