diff options
author | Alexandre Flament <alex@al-f.net> | 2020-12-16 13:41:32 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-12-17 11:39:36 +0100 |
commit | 7ec8bc3ea76516e33318c67165161df5c1efdd36 (patch) | |
tree | 6c9dff310882db816cada8662ef5ed2b8a8158e8 /tests/unit | |
parent | c0cc01e936593ff3df828fa3bb834507c45cd7ac (diff) | |
download | searxng-7ec8bc3ea76516e33318c67165161df5c1efdd36.tar.gz searxng-7ec8bc3ea76516e33318c67165161df5c1efdd36.zip |
[mod] split searx.search into different processors
see searx.search.processors.abstract.EngineProcessor
First the method searx call the get_params method.
If the return value is not None, then the searx call the method search.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/test_search.py | 3 | ||||
-rw-r--r-- | tests/unit/test_standalone_searx.py | 5 | ||||
-rw-r--r-- | tests/unit/test_webadapter.py | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/tests/unit/test_search.py b/tests/unit/test_search.py index 464a9b37d..9938a43a5 100644 --- a/tests/unit/test_search.py +++ b/tests/unit/test_search.py @@ -3,7 +3,6 @@ from searx.testing import SearxTestCase from searx.search import SearchQuery, EngineRef import searx.search -import searx.engines SAFESEARCH = 0 @@ -39,7 +38,7 @@ class SearchTestCase(SearxTestCase): @classmethod def setUpClass(cls): - searx.engines.initialize_engines(TEST_ENGINES) + searx.search.initialize(TEST_ENGINES) def test_timeout_simple(self): searx.search.max_request_timeout = None diff --git a/tests/unit/test_standalone_searx.py b/tests/unit/test_standalone_searx.py index 74e31369f..06d70246a 100644 --- a/tests/unit/test_standalone_searx.py +++ b/tests/unit/test_standalone_searx.py @@ -8,8 +8,7 @@ import sys from mock import Mock, patch from nose2.tools import params -from searx.search import SearchQuery, EngineRef -from searx.engines import initialize_engines +from searx.search import SearchQuery, EngineRef, initialize from searx.testing import SearxTestCase @@ -30,7 +29,7 @@ class StandaloneSearx(SearxTestCase): def setUpClass(cls): engine_list = [{'engine': 'dummy', 'name': 'engine1', 'shortcut': 'e1'}] - initialize_engines(engine_list) + initialize(engine_list) def test_parse_argument_no_args(self): """Test parse argument without args.""" diff --git a/tests/unit/test_webadapter.py b/tests/unit/test_webadapter.py index f620cf300..32417f019 100644 --- a/tests/unit/test_webadapter.py +++ b/tests/unit/test_webadapter.py @@ -17,7 +17,7 @@ TEST_ENGINES = [ 'categories': 'general', 'shortcut': 'do', 'timeout': 3.0, - 'offline': True, + 'engine_type': 'offline', 'tokens': ['my-token'], }, ] @@ -28,7 +28,7 @@ class ValidateQueryCase(SearxTestCase): @classmethod def setUpClass(cls): - searx.engines.initialize_engines(TEST_ENGINES) + searx.search.initialize(TEST_ENGINES) def test_query_private_engine_without_token(self): preferences = Preferences(['oscar'], ['general'], engines, []) |