2024-03-11 14:06:26 +01:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# pylint: disable=missing-module-docstring
|
2016-11-19 20:53:51 +01:00
|
|
|
|
|
|
|
from mock import Mock
|
|
|
|
|
|
|
|
from searx.answerers import answerers
|
2021-09-02 16:01:34 +02:00
|
|
|
from tests import SearxTestCase
|
2016-11-19 20:53:51 +01:00
|
|
|
|
|
|
|
|
2024-03-11 14:06:26 +01:00
|
|
|
class AnswererTest(SearxTestCase): # pylint: disable=missing-class-docstring
|
2016-11-19 20:53:51 +01:00
|
|
|
def test_unicode_input(self):
|
|
|
|
query = Mock()
|
2020-08-06 17:42:46 +02:00
|
|
|
unicode_payload = 'árvíztűrő tükörfúrógép'
|
2016-11-19 20:53:51 +01:00
|
|
|
for answerer in answerers:
|
2020-08-06 17:42:46 +02:00
|
|
|
query.query = '{} {}'.format(answerer.keywords[0], unicode_payload)
|
2016-11-19 20:53:51 +01:00
|
|
|
self.assertTrue(isinstance(answerer.answer(query), list))
|