Skip to content

Conversation

@zulquer
Copy link
Collaborator

@zulquer zulquer commented Jul 24, 2025

This pull request refines the generate_from_shopping_cart method to handle unique tax table selectors more effectively and updates the corresponding test cases to ensure correctness. The key changes include introducing logic for deduplication of tax table selectors, updating tests to reflect this change, and adding a new test case for scenarios with duplicate tax table selectors.

Enhancements to generate_from_shopping_cart:

Updates to test cases:

@zulquer zulquer requested review from Copilot and danielcivit July 24, 2025 11:40

This comment was marked as outdated.

@danielcivit danielcivit changed the base branch from PTHMINT-77 to master July 24, 2025 13:05
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.48%. Comparing base (14f1825) to head (9db8adf).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   90.48%   90.48%           
=======================================
  Files         107      107           
  Lines        2322     2323    +1     
=======================================
+ Hits         2101     2102    +1     
  Misses        221      221           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

danielcivit and others added 2 commits July 24, 2025 15:12
…nts/test_integration_orders_components_checkout_options.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nts/test_integration_orders_components_checkout_options.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@danielcivit danielcivit requested a review from Copilot July 24, 2025 13:12
Copy link

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

This pull request fixes duplicate tax generation in the generate_from_shopping_cart method by deduplicating tax table selectors and updates tests to ensure proper validation of this behavior.

  • Introduced deduplication logic using a set to ensure unique tax table selectors
  • Modified existing test to sort tax rules for consistent comparison
  • Added new test case to validate duplicate tax table selector handling

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/multisafepay/api/paths/orders/request/components/checkout_options.py Implemented deduplication logic using set comprehension to avoid duplicate tax rules
tests/multisafepay/integration/api/path/orders/request/components/test_integration_orders_components_checkout_options.py Updated existing test with sorting logic and added new test for duplicate tax table selector scenario
Comments suppressed due to low confidence (1)

tests/multisafepay/integration/api/path/orders/request/components/test_integration_orders_components_checkout_options.py:174

  • The test uses identical CartItem objects which may not adequately test the deduplication logic. Consider using different items with the same tax_table_selector to better validate that deduplication works across different products.
                name="Geometric Candle Holders",

@danielcivit danielcivit merged commit 26cb336 into master Jul 24, 2025
6 checks passed
@danielcivit danielcivit deleted the PTHMINT-78 branch July 24, 2025 13:31
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.

3 participants