Skip to content

Usage tests: price selection and image URL#217

Open
NandaScott wants to merge 1 commit into
prd/behavior-and-convenience-usage-testsfrom
sandcastle/issue-209
Open

Usage tests: price selection and image URL#217
NandaScott wants to merge 1 commit into
prd/behavior-and-convenience-usage-testsfrom
sandcastle/issue-209

Conversation

@NandaScott
Copy link
Copy Markdown
Owner

Closes #209

Opened by Sandcastle. 1 commit(s) on sandcastle/issue-209.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py with 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_FIXTURES in tests/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants