summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-10-02 17:18:05 +0200
committerAlexandre Flament <alex@al-f.net>2021-10-02 17:18:05 +0200
commit253b8503765b6f0d21135254277e72d17a51e04a (patch)
treec52ae4a1d47140d5e531e78b7fbc11e0a354c7ec /tests
parent9e266ecad3cc20faf2c12cdab7862c29cf8df2ec (diff)
downloadsearxng-253b8503765b6f0d21135254277e72d17a51e04a.tar.gz
searxng-253b8503765b6f0d21135254277e72d17a51e04a.zip
SearXNG: SEARXNG_SETTINGS_PATH
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/__init__.py2
-rw-r--r--tests/unit/test_settings_loader.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py
index 8266c675a..d1c97ec81 100644
--- a/tests/unit/__init__.py
+++ b/tests/unit/__init__.py
@@ -2,5 +2,5 @@ import os
from os.path import dirname, sep, abspath
# In unit tests the user settings from unit/settings/test_settings.yml are used.
-os.environ['SEARX_SETTINGS_PATH'] = abspath(
+os.environ['SEARXNG_SETTINGS_PATH'] = abspath(
dirname(__file__) + sep + 'settings' + sep + 'test_settings.yml')
diff --git a/tests/unit/test_settings_loader.py b/tests/unit/test_settings_loader.py
index ad9fc6e95..9e04df653 100644
--- a/tests/unit/test_settings_loader.py
+++ b/tests/unit/test_settings_loader.py
@@ -58,14 +58,14 @@ class TestUserSettings(SearxTestCase):
def test_user_settings_not_found(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': '/dev/null'}):
+ {'SEARXNG_SETTINGS_PATH': '/dev/null'}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('load the default settings from'))
self.assertEqual(settings['server']['secret_key'], "ultrasecretkey")
def test_user_settings(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': join(test_dir, 'settings/user_settings_simple.yml')}):
+ {'SEARXNG_SETTINGS_PATH': join(test_dir, 'settings/user_settings_simple.yml')}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('merge the default settings'))
self.assertEqual(settings['server']['secret_key'], "user_secret_key")
@@ -73,7 +73,7 @@ class TestUserSettings(SearxTestCase):
def test_user_settings_remove(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': join(test_dir, 'settings/user_settings_remove.yml')}):
+ {'SEARXNG_SETTINGS_PATH': join(test_dir, 'settings/user_settings_remove.yml')}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('merge the default settings'))
self.assertEqual(settings['server']['secret_key'], "user_secret_key")
@@ -85,7 +85,7 @@ class TestUserSettings(SearxTestCase):
def test_user_settings_remove2(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': join(test_dir, 'settings/user_settings_remove2.yml')}):
+ {'SEARXNG_SETTINGS_PATH': join(test_dir, 'settings/user_settings_remove2.yml')}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('merge the default settings'))
self.assertEqual(settings['server']['secret_key'], "user_secret_key")
@@ -102,7 +102,7 @@ class TestUserSettings(SearxTestCase):
def test_user_settings_keep_only(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': join(test_dir, 'settings/user_settings_keep_only.yml')}):
+ {'SEARXNG_SETTINGS_PATH': join(test_dir, 'settings/user_settings_keep_only.yml')}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('merge the default settings'))
engine_names = [engine['name'] for engine in settings['engines']]
@@ -112,7 +112,7 @@ class TestUserSettings(SearxTestCase):
def test_custom_settings(self):
with patch.dict(settings_loader.environ,
- {'SEARX_SETTINGS_PATH': join(test_dir, 'settings/user_settings.yml')}):
+ {'SEARXNG_SETTINGS_PATH': join(test_dir, 'settings/user_settings.yml')}):
settings, msg = settings_loader.load_settings()
self.assertTrue(msg.startswith('load the user settings from'))
self.assertEqual(settings['server']['port'], 9000)