Repository navigation
test: pin the Python location client's failure paths - #269
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (one intrinsic pass, anchored on CI run 43375094535 and a local mutation check):
Observations (judgment calls, not blocking):
This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
A Stage B (unit-test expansion) cycle covering the Python client's
LocationService(src/main/python/preponderous/viron/services/locationService.py). It follows the entity (#266), grid (#267) and environment (#268) clients and completes the set. Thirty-six characterization tests are added tosrc/test/python/preponderous/viron/services/test_locationService.py. No production code is changed.What is now pinned:
Exception, not anHTTPError. UnlikeGridServiceandEnvironmentService, the location client checks a 404 itself beforeraise_for_status. This applies toget_location_by_id,get_neighbors,get_location_of_entity,get_entity_ids_at_location,is_location_occupied,add_entity_to_location,remove_entity_from_current_locationandmove_entity_to_location. The exception's exact message is pinned, andraise_for_statusandjson()are confirmed not to be called.get_location_of_entity's 404 had no test before this PR.Exception. Foradd_entity_to_locationthe message is "Entity N is already placed at another location", and formove_entity_to_locationit is "Target location N is already occupied".HTTPError. A 400 on any of the five list reads does too, and the list reads never read the body in that case.get_placements(0)sendsenvironmentId=0. The method compares againstNone, so a zero is not dropped (the server's@Min(1)then rejects it).ConnectionError) on reads and on all three write verbs.get_all_locationswas checked.TypeError.get_entity_ids_at_locationandis_location_occupiedreturn the decoded body unchanged, sois_location_occupiedcan returnNonerather than abool.The split between plain
ExceptionandHTTPErroris recorded as current behaviour, not endorsed as correct. If the clients are later made consistent, these tests mark exactly what would change.Deferred issues
pom.xmlbuild-pipeline change beyond one cycle).Test plan
pytest -q(pytest 9.0.3): 201 passed (165 before, 36 new)python3 -m pytest -q(pytest 7.1.3, Python 3.8): 201 passedCIworkflow's Python jobs run this suite. No Java file is touched.No tracking issue — gap 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