From 4de753717d489d238dfd73e7fb089f34825da817 Mon Sep 17 00:00:00 2001 From: JYOTHINARAYANSETTY <49671483+JYOTHINARAYANSETTY@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:42:01 -0400 Subject: [PATCH] Add newly discovered streams to the metadata (#171) * Add newly discovered streams to the metadata * updated expected_streams method name to match the tap-tester framework structure --- tests/base.py | 20 +++++++++++++++++ tests/sfbase.py | 25 +++++++++++++++++++--- tests/test_salesforce_api_per_run_quota.py | 2 +- tests/test_salesforce_api_total_quota.py | 2 +- tests/test_salesforce_sync_canary.py | 2 +- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/tests/base.py b/tests/base.py index 137d3587..e9dae5ab 100644 --- a/tests/base.py +++ b/tests/base.py @@ -855,6 +855,26 @@ def expected_metadata(self): 'WorkStepTemplateFeed': default, 'WorkStepTemplateHistory': incremental_created_date, 'WorkStepTemplateShare': incremental_last_modified, + #added on 10/14/2023 + 'BuyerGroup': default, + 'BuyerGroupFeed': default, + 'BuyerGroupHistory': incremental_created_date, + 'BuyerGroupShare': incremental_last_modified, + 'CartDeliveryGroupMethod': default, + 'ProductCatalog': default, + 'ProductCatalogFeed': default, + 'ProductCatalogHistory': incremental_created_date, + 'ProductCatalogShare': incremental_last_modified, + 'ProductCategory': default, + 'ProductCategoryFeed': default, + 'ProductCategoryHistory': incremental_created_date, + 'ProductCategoryProduct': default, + 'ProductCategoryProductHistory': incremental_created_date, + 'PromotionSegmentBuyerGroup': default, + 'PromotionSegmentBuyerGroupHistory': incremental_created_date, + 'WebStoreBuyerGroup': default, + 'WebStoreCatalog': default, + 'WebStoreCatalogHistory': incremental_created_date, } def rest_only_streams(self): diff --git a/tests/sfbase.py b/tests/sfbase.py index a4019ca4..d2644bd1 100644 --- a/tests/sfbase.py +++ b/tests/sfbase.py @@ -845,7 +845,27 @@ def expected_metadata(): 'WorkStepTemplateFeed': default, 'WorkStepTemplateHistory': incremental_created_date, 'WorkStepTemplateShare': incremental_last_modified, - } + #added on 10/14/2023 + 'BuyerGroup': default, + 'BuyerGroupFeed': default, + 'BuyerGroupHistory': incremental_created_date, + 'BuyerGroupShare': incremental_last_modified, + 'CartDeliveryGroupMethod': default, + 'ProductCatalog': default, + 'ProductCatalogFeed': default, + 'ProductCatalogHistory': incremental_created_date, + 'ProductCatalogShare': incremental_last_modified, + 'ProductCategory': default, + 'ProductCategoryFeed': default, + 'ProductCategoryHistory': incremental_created_date, + 'ProductCategoryProduct': default, + 'ProductCategoryProductHistory': incremental_created_date, + 'PromotionSegmentBuyerGroup': default, + 'PromotionSegmentBuyerGroupHistory': incremental_created_date, + 'WebStoreBuyerGroup': default, + 'WebStoreCatalog': default, + 'WebStoreCatalogHistory': incremental_created_date, + } @staticmethod @@ -865,10 +885,9 @@ def rest_only_streams(): 'UndecidedEventRelation', } - def expected_streams(self): + def expected_stream_names(self): """A set of expected stream names""" streams = set(self.expected_metadata().keys()) - if self.salesforce_api == 'BULK': return streams.difference(self.rest_only_streams()) return streams diff --git a/tests/test_salesforce_api_per_run_quota.py b/tests/test_salesforce_api_per_run_quota.py index 584301df..57ccee20 100644 --- a/tests/test_salesforce_api_per_run_quota.py +++ b/tests/test_salesforce_api_per_run_quota.py @@ -39,7 +39,7 @@ def name(): return "tt_sf_api_quota" def streams_to_test(self): - return self.expected_streams().difference(self.streams_to_exclude) + return self.expected_stream_names().difference(self.streams_to_exclude) @staticmethod def streams_to_selected_fields(): diff --git a/tests/test_salesforce_api_total_quota.py b/tests/test_salesforce_api_total_quota.py index b6cd10bd..5ff23c00 100644 --- a/tests/test_salesforce_api_total_quota.py +++ b/tests/test_salesforce_api_total_quota.py @@ -38,7 +38,7 @@ def name(): return "tt_sf_api_quota_total" def streams_to_test(self): - return self.expected_streams().difference(self.streams_to_exclude) + return self.expected_stream_names().difference(self.streams_to_exclude) def test_api_total_quota(self): """ diff --git a/tests/test_salesforce_sync_canary.py b/tests/test_salesforce_sync_canary.py index 8aea0a41..5abc62ed 100644 --- a/tests/test_salesforce_sync_canary.py +++ b/tests/test_salesforce_sync_canary.py @@ -27,7 +27,7 @@ def get_properties(): # pylint: disable=arguments-differ } def expected_sync_streams(self): - return self.expected_streams().difference({ + return self.expected_stream_names().difference({ # DATACLOUD_API_DISABLED_EXCEPTION 'DatacloudAddress', 'DatacloudCompany',