mirror of
https://github.com/searxng/searxng.git
synced 2025-07-19 03:09:25 +02:00
[enh] add quick answer functionality with an example answerer
This commit is contained in:
parent
55dc538398
commit
971ed0abd1
7 changed files with 156 additions and 4 deletions
16
tests/unit/test_answerers.py
Normal file
16
tests/unit/test_answerers.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from mock import Mock
|
||||
|
||||
from searx.answerers import answerers
|
||||
from searx.testing import SearxTestCase
|
||||
|
||||
|
||||
class AnswererTest(SearxTestCase):
|
||||
|
||||
def test_unicode_input(self):
|
||||
query = Mock()
|
||||
unicode_payload = u'árvíztűrő tükörfúrógép'
|
||||
for answerer in answerers:
|
||||
query.query = u'{} {}'.format(answerer.keywords[0], unicode_payload)
|
||||
self.assertTrue(isinstance(answerer.answer(query), list))
|
Loading…
Add table
Add a link
Reference in a new issue