327 self, test_results: TestResults, test_name: str, result_container_tests_list: typing.List[ResultContainerTests]
329 self.test_results = test_results
330 self.test_name = test_name
331 self.result_container_tests_list = result_container_tests_list
333 def unique_results(self):
334 """Check the results of each ResultContainer is unique"""
335 urls_list = [rct.result_urls for rct in self.result_container_tests_list]
336 if len(urls_list[0]) > 0:
337 # results on the first page
338 for i, urls_i in enumerate(urls_list):
339 for j, urls_j in enumerate(urls_list):
340 if i < j and urls_i == urls_j:
341 common, diff = _search_query_diff(
342 self.result_container_tests_list[i].search_query,
343 self.result_container_tests_list[j].search_query,
345 common_str = ' '.join(['{}={!r}'.format(k, v) for k, v in common.items()])
346 diff1_str = ', '.join(['{}={!r}'.format(k, v1) for (k, (v1, v2)) in diff.items()])
347 diff2_str = ', '.join(['{}={!r}'.format(k, v2) for (k, (v1, v2)) in diff.items()])
348 self.test_results.add_error(
350 'results are identical for {} and {} ({})'.format(diff1_str, diff2_str, common_str),