diff options
author | Alexandre Flament <alex@al-f.net> | 2021-01-08 19:05:56 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-01-12 11:47:17 +0100 |
commit | f3e1bd308f8abb62b3ce0070973e0a494d15b122 (patch) | |
tree | 26cb73c75c7ba9c58684b432b9eeee42f0766243 /searx | |
parent | 45bfab77d0154c60f58be0453307cb03b48dca35 (diff) | |
download | searxng-f3e1bd308f8abb62b3ce0070973e0a494d15b122.tar.gz searxng-f3e1bd308f8abb62b3ce0070973e0a494d15b122.zip |
[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">
Diffstat (limited to 'searx')
-rw-r--r-- | searx/search/processors/online.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/searx/search/processors/online.py b/searx/search/processors/online.py index 54d63b4c9..0ceb0adf2 100644 --- a/searx/search/processors/online.py +++ b/searx/search/processors/online.py @@ -179,15 +179,15 @@ class OnlineProcessor(EngineProcessor): requests_exception = True elif (issubclass(e.__class__, SearxEngineCaptchaException)): result_container.add_unresponsive_engine(self.engine_name, 'CAPTCHA required') - logger.exception('engine {0} : CAPTCHA') + logger.exception('engine {0} : CAPTCHA'.format(self.engine_name)) suspended_time = e.suspended_time # pylint: disable=no-member elif (issubclass(e.__class__, SearxEngineTooManyRequestsException)): result_container.add_unresponsive_engine(self.engine_name, 'too many requests') - logger.exception('engine {0} : Too many requests') + logger.exception('engine {0} : Too many requests'.format(self.engine_name)) suspended_time = e.suspended_time # pylint: disable=no-member elif (issubclass(e.__class__, SearxEngineAccessDeniedException)): result_container.add_unresponsive_engine(self.engine_name, 'blocked') - logger.exception('engine {0} : Searx is blocked') + logger.exception('engine {0} : Searx is blocked'.format(self.engine_name)) suspended_time = e.suspended_time # pylint: disable=no-member else: result_container.add_unresponsive_engine(self.engine_name, 'unexpected crash') @@ -216,22 +216,24 @@ class OnlineProcessor(EngineProcessor): tests = {} tests['simple'] = { - 'matrix': {'query': ('time', 'time')}, + 'matrix': {'query': ('life', 'computer')}, 'result_container': ['not_empty'], } if getattr(self.engine, 'paging', False): - # [1, 2, 3] --> isinstance(l, (list, tuple)) ?? tests['paging'] = { 'matrix': {'query': 'time', 'pageno': (1, 2, 3)}, 'result_container': ['not_empty'], 'test': ['unique_results'] } + if 'general' in self.engine.categories: + # avoid documentation about HTML tags (<time> and <input type="time">) + tests['paging']['matrix']['query'] = 'news' if getattr(self.engine, 'time_range', False): tests['time_range'] = { - 'matrix': {'query': 'time', + 'matrix': {'query': 'news', 'time_range': (None, 'day')}, 'result_container': ['not_empty'], 'test': ['unique_results'] |