summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-11-19 20:53:51 +0100
committerAdam Tauber <asciimoo@gmail.com>2016-11-19 20:53:51 +0100
commit971ed0abd159625bd01d0b3ca52c90b394711d77 (patch)
tree952a32dea19318981f959f073a68e731c6c017ea /tests
parent55dc538398090e437c5e495dddad983a7870d09b (diff)
downloadsearxng-971ed0abd159625bd01d0b3ca52c90b394711d77.tar.gz
searxng-971ed0abd159625bd01d0b3ca52c90b394711d77.zip
[enh] add quick answer functionality with an example answerer
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_answerers.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/test_answerers.py b/tests/unit/test_answerers.py
new file mode 100644
index 000000000..bd8789a7e
--- /dev/null
+++ b/tests/unit/test_answerers.py
@@ -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))