fix: route invalid_input order requests through the discovered endpoint - #75
Open
XiaolongZhang-TT wants to merge 1 commit into
Conversation
The four order GET/PUT calls in invalid_input_test.py used a raw
"/orders/{order_id}" path against the httpx base_url, while every call in
order_test.py goes through self.get_order_url(order_id), which resolves the
shopping service endpoint discovered from /.well-known/ucp. When the shopping
service is not hosted at the server root, the raw path 404s before validation
runs, so these tests would fail (or pass) for the wrong reason instead of
exercising the intended 422 validation path.
Use get_order_url to match the rest of the suite; behavior is unchanged for
the sample server, whose shopping endpoint is at the root.
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.
Description
The four order
GET/PUTcalls ininvalid_input_test.pyused a raw"/orders/{order_id}"path against the httpxbase_url, while every order call inorder_test.pygoes throughself.get_order_url(order_id), which resolves the shopping-service endpoint discovered from/.well-known/ucp:The raw path only works when the shopping service is hosted at the server root. For a conformant server whose shopping service lives at a sub-path, these requests 404 before validation ever runs — so
test_invalid_adjustment_statusandtest_malformed_adjustment_payloadwould fail (or pass) for the wrong reason (404 instead of the intended 422) instead of exercising the intended validation path.Switched all four to
get_order_urlto match the rest of the suite. Behavior is unchanged for the sample server, whose shopping endpoint is at the root.Type of change
Is this a Breaking Change or Removal?
N/A — test-only fix, no schema/field removal.
Checklist