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