.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.search.checker.impl.TestResults Class Reference
+ Collaboration diagram for searx.search.checker.impl.TestResults:

Public Member Functions

 __init__ (self)
 
 add_error (self, test, message, *args)
 
 add_language (self, language)
 
 successful (self)
 
 __iter__ (self)
 

Public Attributes

dict errors = {}
 
dict logs = {}
 
typing.Set[str] languages = set()
 

Static Private Attributes

str __slots__ = 'errors', 'logs', 'languages'
 

Detailed Description

Definition at line 153 of file impl.py.

Constructor & Destructor Documentation

◆ __init__()

searx.search.checker.impl.TestResults.__init__ ( self)

Definition at line 157 of file impl.py.

157 def __init__(self):
158 self.errors: typing.Dict[str, typing.List[str]] = {}
159 self.logs: typing.Dict[str, typing.List[typing.Any]] = {}
160 self.languages: typing.Set[str] = set()
161

Member Function Documentation

◆ __iter__()

searx.search.checker.impl.TestResults.__iter__ ( self)

Definition at line 179 of file impl.py.

179 def __iter__(self):
180 for test_name, errors in self.errors.items():
181 for error in sorted(errors):
182 yield (test_name, error)
183
184

References searx.search.checker.background.EngineErr.errors, searx.search.checker.impl.TestResults.errors, and searx.webapp.ExtendedRequest.errors.

◆ add_error()

searx.search.checker.impl.TestResults.add_error ( self,
test,
message,
* args )

Definition at line 162 of file impl.py.

162 def add_error(self, test, message, *args):
163 # message to self.errors
164 errors_for_test = self.errors.setdefault(test, [])
165 if message not in errors_for_test:
166 errors_for_test.append(message)
167 # (message, *args) to self.logs
168 logs_for_test = self.logs.setdefault(test, [])
169 if (message, *args) not in logs_for_test:
170 logs_for_test.append((message, *args))
171

References searx.search.checker.background.EngineErr.errors, searx.search.checker.impl.TestResults.errors, searx.webapp.ExtendedRequest.errors, and searx.search.checker.impl.TestResults.logs.

◆ add_language()

searx.search.checker.impl.TestResults.add_language ( self,
language )

Definition at line 172 of file impl.py.

172 def add_language(self, language):
173 self.languages.add(language)
174

References searx.enginelib.traits.EngineTraits.languages, searx.query.RawTextQuery.languages, searx.search.checker.impl.ResultContainerTests.languages, and searx.search.checker.impl.TestResults.languages.

◆ successful()

searx.search.checker.impl.TestResults.successful ( self)

Definition at line 176 of file impl.py.

176 def successful(self):
177 return len(self.errors) == 0
178

References searx.search.checker.background.EngineErr.errors, searx.search.checker.impl.TestResults.errors, and searx.webapp.ExtendedRequest.errors.

Member Data Documentation

◆ __slots__

str searx.search.checker.impl.TestResults.__slots__ = 'errors', 'logs', 'languages'
staticprivate

Definition at line 155 of file impl.py.

◆ errors

searx.search.checker.impl.TestResults.errors = {}

◆ languages

typing.Set[str] searx.search.checker.impl.TestResults.languages = set()

◆ logs

dict searx.search.checker.impl.TestResults.logs = {}

Definition at line 159 of file impl.py.

Referenced by searx.search.checker.impl.TestResults.add_error().


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