Skip to content

Commit

Permalink
fix all_fields test (#176)
Browse files Browse the repository at this point in the history
* fix all_fields test

* pr review comments

* pr review comments
  • Loading branch information
JYOTHINARAYANSETTY authored Aug 17, 2023
1 parent a475c70 commit 09c0a67
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_all_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ def test_run(self):

# verify all fields for a stream were replicated
self.assertGreater(len(expected_all_keys), len(expected_automatic_keys))
self.assertTrue(expected_automatic_keys.issubset(expected_all_keys), msg=f'{expected_automatic_keys-expected_all_keys} is not in "expected_all_keys"')

if stream == 'abandoned_checkouts':
expected_all_keys.remove('billing_address')
elif stream == 'orders':
# No field named 'order_adjustments' present in the 'order' object
# Documentation: https://shopify.dev/api/admin-rest/2021-10/resources/order#resource_object
expected_all_keys.remove('order_adjustments')
self.assertTrue(expected_automatic_keys.issubset(expected_all_keys),
msg=f'{expected_automatic_keys-expected_all_keys} is not in "expected_all_keys"')

if stream == 'orders':
# No field named 'order_adjustments', 'total_price_usd' present in the 'order' object
# Documentation: https://shopify.dev/api/admin-rest/2021-10/resources/order#resource_object
# https://jira.talendforge.org/browse/TDL-15985
bad_schema_fields = {'order_adjustments', 'total_price_usd'}
expected_all_keys = expected_all_keys - bad_schema_fields

self.assertSetEqual(expected_all_keys, actual_all_keys)

0 comments on commit 09c0a67

Please sign in to comment.