on master help sign in
[mod] checker: minor adjustements on the default tests

the query "time" is convinient because most of the search engine will return some results, but some engines in the general category will return documentation about the HTML tags <time> or <input type="time">

commitf3e1bd308f8abb62b3ce0070973e0a494d15b122 authorAlexandre Flament <alex@al-f.net> dateFri 8 Jan 2021, 19:05 (6 years ago) parent45bfab7
1 file changed+8−6
searx/search/processors/online.py+8−6
searx/search/processors/online.py+8−6
@@ -179,15 +179,15 @@ class OnlineProcessor(EngineProcessor):
179179 requests_exception = True
180180 elif (issubclass(e.__class__, SearxEngineCaptchaException)):
181181 result_container.add_unresponsive_engine(self.engine_name, 'CAPTCHA required')
182− logger.exception('engine {0} : CAPTCHA')
182+ logger.exception('engine {0} : CAPTCHA'.format(self.engine_name))
183183 suspended_time = e.suspended_time # pylint: disable=no-member
184184 elif (issubclass(e.__class__, SearxEngineTooManyRequestsException)):
185185 result_container.add_unresponsive_engine(self.engine_name, 'too many requests')
186− logger.exception('engine {0} : Too many requests')
186+ logger.exception('engine {0} : Too many requests'.format(self.engine_name))
187187 suspended_time = e.suspended_time # pylint: disable=no-member
188188 elif (issubclass(e.__class__, SearxEngineAccessDeniedException)):
189189 result_container.add_unresponsive_engine(self.engine_name, 'blocked')
190− logger.exception('engine {0} : Searx is blocked')
190+ logger.exception('engine {0} : Searx is blocked'.format(self.engine_name))
191191 suspended_time = e.suspended_time # pylint: disable=no-member
192192 else:
193193 result_container.add_unresponsive_engine(self.engine_name, 'unexpected crash')
@@ -216,22 +216,24 @@ class OnlineProcessor(EngineProcessor):
216216 tests = {}
217217
218218 tests['simple'] = {
219− 'matrix': {'query': ('time', 'time')},
219+ 'matrix': {'query': ('life', 'computer')},
220220 'result_container': ['not_empty'],
221221 }
222222
223223 if getattr(self.engine, 'paging', False):
224− # [1, 2, 3] --> isinstance(l, (list, tuple)) ??
225224 tests['paging'] = {
226225 'matrix': {'query': 'time',
227226 'pageno': (1, 2, 3)},
228227 'result_container': ['not_empty'],
229228 'test': ['unique_results']
230229 }
230+ if 'general' in self.engine.categories:
231+ # avoid documentation about HTML tags (<time> and <input type="time">)
232+ tests['paging']['matrix']['query'] = 'news'
231233
232234 if getattr(self.engine, 'time_range', False):
233235 tests['time_range'] = {
234− 'matrix': {'query': 'time',
236+ 'matrix': {'query': 'news',
235237 'time_range': (None, 'day')},
236238 'result_container': ['not_empty'],
237239 'test': ['unique_results']