Usage tests: price selection and image URL#217
Open
NandaScott wants to merge 1 commit into
Open
Conversation
Tests lowest_price/highest_price across all-present, partial-null, and all-null price fixtures, and get_image_url for normal cards, DFC (parametrized against transform + modal_dfc corpus), and no-image graceful degradation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds usage-level tests for lowest_price, highest_price, and get_image_url on card objects, covering present / partial-null / all-null price scenarios and normal vs. double-faced card image URL resolution (including graceful no-image degradation). Four small synthetic JSON fixtures are added and registered in tests/usage/conftest.py so the existing stub-seam harness can serve them through cards/named.
Changes:
- New
tests/usage/test_cards_price_and_image.pywith eight tests, including a parametrized DFC case over the existing transform / modal_dfc corpus fixtures. - Four synthetic
cards_named__*fixtures for prices_mixed, prices_partial, prices_all_null, and image_none. - Registered the four new fixture keys in
_PAYLOAD_FIXTURESintests/usage/conftest.py.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/usage/test_cards_price_and_image.py | New tests for price-selection and image-URL methods, including DFC parametrization. |
| tests/usage/fixtures/cards_named__prices_mixed.json | Synthetic fixture: all price fields populated. |
| tests/usage/fixtures/cards_named__prices_partial.json | Synthetic fixture: one populated price, rest null. |
| tests/usage/fixtures/cards_named__prices_all_null.json | Synthetic fixture: all prices null. |
| tests/usage/fixtures/cards_named__image_none.json | Synthetic fixture: card payload with no image data. |
| tests/usage/conftest.py | Registers the four new synthetic payload fixtures under cards/named. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+58
to
+61
| def test_by_id__id__get_image_url__dfc_returns_front_face_url(fixture_name, card_id, request): | ||
| request.getfixturevalue(fixture_name) | ||
| card = scrython.cards.ById(id=card_id) | ||
| assert card.get_image_url() is not None |
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.
Closes #209
Opened by Sandcastle. 1 commit(s) on
sandcastle/issue-209.