test_answerers.py 602 B

123456789101112131415161718
  1. # SPDX-License-Identifier: AGPL-3.0-or-later
  2. # pylint: disable=missing-module-docstring
  3. from mock import Mock
  4. from parameterized import parameterized
  5. from searx.answerers import answerers
  6. from tests import SearxTestCase
  7. class AnswererTest(SearxTestCase): # pylint: disable=missing-class-docstring
  8. @parameterized.expand(answerers)
  9. def test_unicode_input(self, answerer):
  10. query = Mock()
  11. unicode_payload = 'árvíztűrő tükörfúrógép'
  12. query.query = '{} {}'.format(answerer.keywords[0], unicode_payload)
  13. self.assertIsInstance(answerer.answer(query), list)