diff options
author | Alexandre Flament <alex@al-f.net> | 2021-06-01 08:07:26 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-06-01 08:10:15 +0200 |
commit | 6fa114c9ba0f9e20168754dd4cbd03e5defef631 (patch) | |
tree | 680fbda0bcf0a405c96f081139fb999aff752af9 /tests | |
parent | 4b07df62e5906e98315e9e856db8f39b2f28f36e (diff) | |
download | searxng-6fa114c9ba0f9e20168754dd4cbd03e5defef631.tar.gz searxng-6fa114c9ba0f9e20168754dd4cbd03e5defef631.zip |
[mod] settings_default: remove searx.search.max_request_timeout global variable
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_search.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/test_search.py b/tests/unit/test_search.py index 72732032e..b0988a0c8 100644 --- a/tests/unit/test_search.py +++ b/tests/unit/test_search.py @@ -2,6 +2,7 @@ from searx.testing import SearxTestCase from searx.search import SearchQuery, EngineRef +from searx import settings import searx.search @@ -41,7 +42,7 @@ class SearchTestCase(SearxTestCase): searx.search.initialize(TEST_ENGINES) def test_timeout_simple(self): - searx.search.max_request_timeout = None + settings['outgoing']['max_request_timeout'] = None search_query = SearchQuery('test', [EngineRef(PUBLIC_ENGINE_NAME, 'general')], 'en-US', SAFESEARCH, PAGENO, None, None) search = searx.search.Search(search_query) @@ -49,7 +50,7 @@ class SearchTestCase(SearxTestCase): self.assertEqual(search.actual_timeout, 3.0) def test_timeout_query_above_default_nomax(self): - searx.search.max_request_timeout = None + settings['outgoing']['max_request_timeout'] = None search_query = SearchQuery('test', [EngineRef(PUBLIC_ENGINE_NAME, 'general')], 'en-US', SAFESEARCH, PAGENO, None, 5.0) search = searx.search.Search(search_query) @@ -57,7 +58,7 @@ class SearchTestCase(SearxTestCase): self.assertEqual(search.actual_timeout, 3.0) def test_timeout_query_below_default_nomax(self): - searx.search.max_request_timeout = None + settings['outgoing']['max_request_timeout'] = None search_query = SearchQuery('test', [EngineRef(PUBLIC_ENGINE_NAME, 'general')], 'en-US', SAFESEARCH, PAGENO, None, 1.0) search = searx.search.Search(search_query) @@ -65,7 +66,7 @@ class SearchTestCase(SearxTestCase): self.assertEqual(search.actual_timeout, 1.0) def test_timeout_query_below_max(self): - searx.search.max_request_timeout = 10.0 + settings['outgoing']['max_request_timeout'] = 10.0 search_query = SearchQuery('test', [EngineRef(PUBLIC_ENGINE_NAME, 'general')], 'en-US', SAFESEARCH, PAGENO, None, 5.0) search = searx.search.Search(search_query) @@ -73,7 +74,7 @@ class SearchTestCase(SearxTestCase): self.assertEqual(search.actual_timeout, 5.0) def test_timeout_query_above_max(self): - searx.search.max_request_timeout = 10.0 + settings['outgoing']['max_request_timeout'] = 10.0 search_query = SearchQuery('test', [EngineRef(PUBLIC_ENGINE_NAME, 'general')], 'en-US', SAFESEARCH, PAGENO, None, 15.0) search = searx.search.Search(search_query) |