.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.search.checker.impl.CheckerTests Class Reference

Public Member Functions

 __init__ (self, TestResults test_results, str test_name, typing.List[ResultContainerTests] result_container_tests_list)
 
 unique_results (self)
 

Public Attributes

 test_results = test_results
 
 test_name = test_name
 
 result_container_tests_list = result_container_tests_list
 

Static Private Attributes

str __slots__ = 'test_results', 'test_name', 'result_container_tests_list'
 

Detailed Description

Definition at line 322 of file impl.py.

Constructor & Destructor Documentation

◆ __init__()

searx.search.checker.impl.CheckerTests.__init__ ( self,
TestResults test_results,
str test_name,
typing.List[ResultContainerTests] result_container_tests_list )

Definition at line 326 of file impl.py.

328 ):
329 self.test_results = test_results
330 self.test_name = test_name
331 self.result_container_tests_list = result_container_tests_list
332

Member Function Documentation

◆ unique_results()

searx.search.checker.impl.CheckerTests.unique_results ( self)
Check the results of each ResultContainer is unique

Definition at line 333 of file impl.py.

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,
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

Member Data Documentation

◆ __slots__

str searx.search.checker.impl.CheckerTests.__slots__ = 'test_results', 'test_name', 'result_container_tests_list'
staticprivate

Definition at line 324 of file impl.py.

◆ result_container_tests_list

searx.search.checker.impl.CheckerTests.result_container_tests_list = result_container_tests_list

Definition at line 331 of file impl.py.

◆ test_name

searx.search.checker.impl.CheckerTests.test_name = test_name

◆ test_results

searx.search.checker.impl.CheckerTests.test_results = test_results

The documentation for this class was generated from the following file: