Add tests for searx.engines.(dummy|github)

This commit is contained in:
Gabor Nagy 2014-07-14 15:33:56 +02:00
parent 233599ae5a
commit f705800612
4 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,26 @@
from searx.engines import dummy
from searx.testing import SearxTestCase
class TestDummyEngine(SearxTestCase):
def test_request(self):
test_params = [
[1, 2, 3],
['a'],
[],
1
]
for params in test_params:
self.assertEqual(dummy.request(None, params), params)
def test_response(self):
responses = [
None,
[],
True,
dict(),
tuple()
]
for response in responses:
self.assertEqual(dummy.response(response), [])