mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
Add tests for searx.engines.(dummy|github)
This commit is contained in:
parent
233599ae5a
commit
f705800612
4 changed files with 89 additions and 0 deletions
26
searx/tests/engines/test_dummy.py
Normal file
26
searx/tests/engines/test_dummy.py
Normal 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), [])
|
Loading…
Add table
Add a link
Reference in a new issue