[fix] checker: minor fix about language detection

This commit is contained in:
Alexandre Flament 2021-01-19 21:29:31 +01:00
parent aa887eb375
commit 3b7b852aa8
2 changed files with 4 additions and 3 deletions

View file

@ -74,6 +74,7 @@ def run(engine_name_list, verbose):
stdout.write(f' {"found languages":15}: {" ".join(sorted(list(checker.test_results.languages)))}\n')
for test_name, logs in checker.test_results.logs.items():
for log in logs:
log = map(lambda l: l if isinstance(l, str) else repr(l), log)
stdout.write(f' {test_name:15}: {RED}{" ".join(log)}{RESET_SEQ}\n')

View file

@ -239,14 +239,14 @@ class OnlineProcessor(EngineProcessor):
'test': ['unique_results']
}
if getattr(self.engine, 'lang', False):
if getattr(self.engine, 'supported_languages', []):
tests['lang_fr'] = {
'matrix': {'query': 'paris', 'lang': 'fr'},
'result_container': ['not_empty', ('has_lang', 'fr')],
'result_container': ['not_empty', ('has_language', 'fr')],
}
tests['lang_en'] = {
'matrix': {'query': 'paris', 'lang': 'en'},
'result_container': ['not_empty', ('has_lang', 'en')],
'result_container': ['not_empty', ('has_language', 'en')],
}
if getattr(self.engine, 'safesearch', False):