feat: change checkout_lifecycle and business_logic test to better reflect business behaviour, update README#63
Merged
damaz91 merged 15 commits intoJul 23, 2026
Conversation
Updates the `test_update_checkout` in `checkout_lifecycle_test.py` to include `buyer` and `fulfillment` (with updated shipping destination) in the update request payload. Also asserts that the response contains the updated buyer details and the new selected destination. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Rewrites the README to focus on how to configure and run conformance tests against any custom UCP server implementation. Moves the Python sample server instructions to an example walkthrough section. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
The `python-sdk` is already configured as an editable dependency in `conformance/pyproject.toml`, so `uv sync` in the `conformance` directory will automatically install it. Syncing it separately is redundant for running the tests. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Some servers (like ucp.business-store.dev) strictly require buyer details (email, name) to be present before a checkout can be completed. This updates the tests to pass a default buyer when creating sessions for completion tests. Also adds test data config for business-store.dev. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Reverts the addition of `test_data/business_store/` configuration files as they were intended for internal testing only. Keeps the generic buyer injection improvements in `checkout_lifecycle_test.py`. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
…rence Avoid using jane.doe@example.com in test_update_checkout, as it is used by other tests expecting no stored address, and the server persists addresses updated during checkout. TAG=agy CONV=23802bfc-a499-4064-b976-79aca6e847ef
…iscount codes - Updates `assert_totals_consistent` helper to calculate expected totals dynamically, accounting for fulfillment, tax, and fee entries returned by the server (rather than assuming total == subtotal). - Handles negative discount total values according to UCP schema. - Replaces hardcoded discount codes in `business_logic_test.py` with dynamic lookup from the fixture context. - Skips tests requiring fixed discounts or multiple discounts if not configured in the test fixtures. - Updates flower shop `test_fixtures.json` to configure the correct discount codes and expected reductions. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Updates README.md to explain that `valid_discount_code_2` and `valid_fixed_discount_code` are optional in `test_fixtures.json` and that their respective tests will be skipped if they are not provided. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
… conformance - Updates `test_fixtures.json` to define discount percentages instead of absolute expected reductions. - Updates conformance test helper to calculate expected percentage discount dynamically. - Updates `test_multiple_discounts_accepted` to calculate both sequential and cumulative discount results, accepting either from the server. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
- Fixes E501 (line too long) and formatting issues using ruff format. - Adds missing docstring to `assert_totals_consistent` helper. - Fixes D401 (imperative mood docstring) and wraps long lines in business_logic_test.py. TAG=agy CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
carolinerg1
approved these changes
Jul 22, 2026
TAG=agy CONV=f0d818cd-0531-40ee-880f-865ddf2b2a5f
Aligns Markdownlint with Prettier to resolve CI conflict. Removes duplicate root .markdownlint.json. TAG=agy CONV=f0d818cd-0531-40ee-880f-865ddf2b2a5f
This was referenced Jul 23, 2026
nicholasjameshall
approved these changes
Jul 23, 2026
Convert discount calculations from truncation (int()) to rounding (round()) to match standard business logic and avoid test failures when fixtures produce fractional cents. TAG=agy CONV=9f52b360-143c-4223-90ca-9a0e665c7c08
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
This PR updates the
test_update_checkoutincheckout_lifecycle_test.pyto includebuyerandfulfillment(with updated shipping destination) in the update request payload. It also asserts that the response contains the updated buyer details and the new selected destination.Category (Required)
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Related Issues
None.
Checklist
!for breaking changes).Screenshots / Logs (if applicable)
None.