.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, TestResults test_results, str test_name, SearchQuery search_query, ResultContainer result_container) | |
result_urls (self) | |
check_basic (self) | |
has_infobox (self) | |
has_answer (self) | |
has_language (self, lang) | |
not_empty (self) | |
one_title_contains (self, str title) | |
Public Attributes | |
test_name = test_name | |
search_query = search_query | |
result_container = result_container | |
typing.Set[str] | languages = set() |
test_results = test_results | |
bool | stop_test = False |
Protected Member Functions | |
None | _record_error (self, str message, *args) |
typing.Optional[str] | _add_language (self, str text) |
_check_result (self, result) | |
_check_results (self, list results) | |
_check_answers (self, answers) | |
_check_infoboxes (self, infoboxes) | |
Static Private Attributes | |
str | __slots__ = 'test_name', 'search_query', 'result_container', 'languages', 'stop_test', 'test_results' |
searx.search.checker.impl.ResultContainerTests.__init__ | ( | self, | |
TestResults | test_results, | ||
str | test_name, | ||
SearchQuery | search_query, | ||
ResultContainer | result_container ) |
|
protected |
Definition at line 209 of file impl.py.
References searx.enginelib.traits.EngineTraits.languages, searx.query.RawTextQuery.languages, searx.search.checker.impl.ResultContainerTests.languages, searx.search.checker.impl.TestResults.languages, searx.search.checker.impl.Checker.test_results, searx.search.checker.impl.CheckerTests.test_results, and searx.search.checker.impl.ResultContainerTests.test_results.
Referenced by searx.search.checker.impl.ResultContainerTests._check_infoboxes(), and searx.search.checker.impl.ResultContainerTests._check_result().
|
protected |
Definition at line 249 of file impl.py.
References searx.search.checker.impl._check_no_html, and searx.search.checker.impl.ResultContainerTests._record_error().
Referenced by searx.search.checker.impl.ResultContainerTests.check_basic().
|
protected |
Definition at line 254 of file impl.py.
References searx.search.checker.impl.ResultContainerTests._add_language(), searx.search.checker.impl._check_no_html, and searx.search.checker.impl.ResultContainerTests._record_error().
Referenced by searx.search.checker.impl.ResultContainerTests.check_basic().
|
protected |
Definition at line 215 of file impl.py.
References searx.search.checker.impl.ResultContainerTests._add_language(), searx.search.checker.impl._check_no_html, searx.search.checker.impl._is_url_image(), and searx.search.checker.impl.ResultContainerTests._record_error().
Referenced by searx.search.checker.impl.ResultContainerTests._check_results().
|
protected |
Definition at line 245 of file impl.py.
References searx.search.checker.impl.ResultContainerTests._check_result().
Referenced by searx.search.checker.impl.ResultContainerTests.check_basic().
|
protected |
Definition at line 204 of file impl.py.
References searx.search.checker.impl._search_query_to_dict(), searx.format, searx.search.checker.impl.ResultContainerTests.search_query, searx.search.Search.search_query, searx.search.checker.impl.CheckerTests.test_name, searx.search.checker.impl.ResultContainerTests.test_name, searx.search.checker.impl.Checker.test_results, searx.search.checker.impl.CheckerTests.test_results, and searx.search.checker.impl.ResultContainerTests.test_results.
Referenced by searx.search.checker.impl.ResultContainerTests._check_answers(), searx.search.checker.impl.ResultContainerTests._check_infoboxes(), searx.search.checker.impl.ResultContainerTests._check_result(), searx.search.checker.impl.ResultContainerTests.check_basic(), and searx.search.checker.impl.ResultContainerTests.has_infobox().
searx.search.checker.impl.ResultContainerTests.check_basic | ( | self | ) |
Definition at line 263 of file impl.py.
References searx.search.checker.impl.ResultContainerTests._check_answers(), searx.search.checker.impl.ResultContainerTests._check_infoboxes(), searx.search.checker.impl.ResultContainerTests._check_results(), searx.search.checker.impl.ResultContainerTests._record_error(), searx.search.checker.impl.ResultContainerTests.result_container, searx.search.Search.result_container, and searx.search.checker.impl.ResultContainerTests.stop_test.
searx.search.checker.impl.ResultContainerTests.has_answer | ( | self | ) |
searx.search.checker.impl.ResultContainerTests.has_infobox | ( | self | ) |
Check the ResultContainer has at least one infobox
Definition at line 280 of file impl.py.
References searx.search.checker.impl.ResultContainerTests._record_error(), searx.search.checker.impl.ResultContainerTests.result_container, and searx.search.Search.result_container.
searx.search.checker.impl.ResultContainerTests.has_language | ( | self, | |
lang ) |
Check at least one title or content of the results is written in the `lang`. Detected using pycld3, may be not accurate
Definition at line 290 of file impl.py.
searx.search.checker.impl.ResultContainerTests.not_empty | ( | self | ) |
Check the ResultContainer has at least one answer or infobox or result
Definition at line 297 of file impl.py.
searx.search.checker.impl.ResultContainerTests.one_title_contains | ( | self, | |
str | title ) |
Check one of the title contains `title` (case insensitive comparison)
Definition at line 313 of file impl.py.
searx.search.checker.impl.ResultContainerTests.result_urls | ( | self | ) |
Definition at line 200 of file impl.py.
References searx.search.checker.impl.ResultContainerTests.result_container, and searx.search.Search.result_container.
|
staticprivate |
typing.Set[str] searx.search.checker.impl.ResultContainerTests.languages = set() |
Definition at line 195 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests._add_language(), searx.search.checker.impl.TestResults.add_language(), and searx.enginelib.traits.EngineTraits.get_language().
searx.search.checker.impl.ResultContainerTests.result_container = result_container |
Definition at line 194 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests.check_basic(), searx.search.checker.impl.ResultContainerTests.has_infobox(), and searx.search.checker.impl.ResultContainerTests.result_urls().
searx.search.checker.impl.ResultContainerTests.search_query = search_query |
Definition at line 193 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests._record_error().
bool searx.search.checker.impl.ResultContainerTests.stop_test = False |
Definition at line 197 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests.check_basic().
searx.search.checker.impl.ResultContainerTests.test_name = test_name |
Definition at line 192 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests._record_error().
searx.search.checker.impl.ResultContainerTests.test_results = test_results |
Definition at line 196 of file impl.py.
Referenced by searx.search.checker.impl.ResultContainerTests._add_language(), and searx.search.checker.impl.ResultContainerTests._record_error().