test: add fulfillment structural conformance module (title distinctness, single group per method) - #68
Merged
damaz91 merged 1 commit intoJul 30, 2026
Conversation
Add fulfillment_structure_test.py covering two normative invariants from the fulfillment extension spec (fulfillment.md) not asserted by the existing fulfillment_test.py: - FUL-001 (Rendering / options[].title "MUST distinguish this option from its siblings"): within a group, every option title is a non-empty string and distinct from its siblings. - FUL-008 (Business Response Behavior, default supports_multi_group: "Business MUST consolidate all items into a single group per method"): a method covering several line items returns exactly one group covering all of them. Assertions operate on the raw response.json() wire payload and are server-agnostic. The module is capability-gated on dev.ucp.shopping.fulfillment and skips honestly when the business emits no options/groups to assert on.
damaz91
approved these changes
Jul 30, 2026
nicholasjameshall
approved these changes
Jul 30, 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
Adds a small conformance module for two structural fulfillment invariants that the existing
fulfillment_test.py(flows, address handling, geography-driven options, free shipping, totals roll-up) does not currently assert:fulfillment.md): anoptions[].titleMUST distinguish the option from its siblings.fulfillment.md, default config): a Business MUST consolidate all items into a single group per method.Tests
Both are server agnostic (they read the raw
response.json()rather than a parsed SDK model), gate ondev.ucp.shopping.fulfillment, and skip honestly when the server emits no options or groups to assert on.test_option_titles_distinguish_siblings: within each method group, every sibling optiontitleis a non-empty string and is distinct within the group.test_default_config_single_group_per_method: under the default configuration, each method returns exactly one group whoseline_item_idscover all of that method's items.Scope
The module intentionally covers only requirements the reference flower shop server can exercise, and documents the exclusions in its docstring:
descriptionnon-repetition andavailable_methods[].descriptionare not asserted because the reference emits neither field, so there is nothing to test.Verification
Run against the reference flower shop server: both tests execute non vacuously (the server returns two distinct title options for a US destination, and consolidates a multi item cart into a single group per method). The full conformance suite stays green with no regressions.