Skip to content

Commit

Permalink
Add newly discovered streams to the metadata (#171)
Browse files Browse the repository at this point in the history
* Add newly discovered streams to the metadata

* updated expected_streams method name to match the tap-tester framework structure
  • Loading branch information
JYOTHINARAYANSETTY authored Oct 16, 2023
1 parent 5ae6b93 commit 4de7537
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 6 deletions.
20 changes: 20 additions & 0 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
25 changes: 22 additions & 3 deletions tests/sfbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_salesforce_api_per_run_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_salesforce_api_total_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_salesforce_sync_canary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4de7537

Please sign in to comment.