Repository navigation
test: pin the Python entity client's failure paths - #266
Merged
Merged
Conversation
The entity client's tests covered only the success path and one network error on a read. Its failure handling is not uniform: the reads and create_entity let raise_for_status's HTTPError propagate, while delete_entity and update_entity_name catch it and re-raise a bare Exception carrying a fixed message and the original error. Both shapes, and the empty-body fallbacks to None and [], are now asserted as they stand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (head
Judgment notes:
Merge-ready: CI is green, the change is test-only, and no do-not-auto-merge path is touched. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This was referenced Nov 11, 2026
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.
Summary
Stage B (unit-test expansion) cycle, aimed at the Python client's
EntityService(src/main/python/preponderous/viron/services/entityService.py). Its tests covered the success path of every method but only one failure: a network error onget_all_entities. Eight characterization tests are added tosrc/test/python/preponderous/viron/services/test_entityService.py. No production code is changed.The client's failure handling is not uniform, and the new tests record both shapes as they are today:
create_entitylet theHTTPErrorfromraise_for_status()propagate unchanged. They are now asserted for a 404 onget_entity_by_idand a 400 oncreate_entity, and in each case.json()is shown never to be read.delete_entityandupdate_entity_namecatch every exception and re-raise a bareExceptionwith a fixed message ("Error deleting entity","Error updating entity name"). The original error is kept asargs[1]. This is asserted for a 404, a 400 and aConnectionError.get_entity_by_idreturnsNoneand the list reads return[]when the body isnull.Observation (not changed here)
Because
delete_entityandupdate_entity_namewrap errors, a caller cannotexcept HTTPErroron them the way it can on every other method in the client, or onEnvironmentService.delete_environmentandGridService.update_grid_name. The original error is still reachable throughargs[1]. This could be by design, since it mirrors the Java client'sEntityServiceException, so it is recorded here and not changed in a test-only cycle.Deferred issues
pom.xmlbuild-pipeline change that is too large for one cycle.Test plan
pytest -q(pytest 9.0.3): 136 passed (128 before, 8 new)python3 -m pytest -q(pytest 7.1.3, Python 3.8): 136 passedCIworkflow's Python job runs this suite; the Java jobs are unaffected because no Java file is touched.No tracking issue. The gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson