def test_compare_names_for_same_urls( source_data, target_data, tagged_fields, expected_messages ): result = p.compare_names_for_same_urls( pd.DataFrame(source_data), pd.DataFrame(target_data), tagged_fields ) assert result == create_result("Compare Names Per Url", expected_messages)
def compare_with_customized_rules(self, source_items, target_items, tagged_fields): if not target_items: return self.save_result( category_rules.get_difference( source_items.key, target_items.key, source_items.df, target_items.df, tagged_fields.get("category", []), ) ) self.save_result( price_rules.compare_prices_for_same_urls( source_items.df, target_items.df, tagged_fields ) ) self.save_result( price_rules.compare_names_for_same_urls( source_items.df, target_items.df, tagged_fields ) ) self.save_result( price_rules.compare_prices_for_same_names( source_items.df, target_items.df, tagged_fields ) )
def compare_with_customized_rules(self, source_items, target_items, tagged_fields): if not target_items: return self.save_result( category_coverage.compare_coverage_per_category( source_items.key, target_items.key, source_items.df, target_items.df, tagged_fields, )) self.save_result( price_rules.compare_prices_for_same_urls(source_items.df, target_items.df, tagged_fields)) self.save_result( price_rules.compare_names_for_same_urls(source_items.df, target_items.df, tagged_fields)) self.save_result( price_rules.compare_prices_for_same_names(source_items.df, target_items.df, tagged_fields))