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
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,
344 )
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(
349 self.test_name,
350 'results are identical for {} and {} ({})'.format(diff1_str, diff2_str, common_str),
351 )
352
353