mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
settings.yml: use_default_settings.categories_as_tabs
Update commit ab130786ab
With use_default_settings,
* categories_as_tabs add new categories
* use_default_settings.categories_as_tabs.remove removes categories
* use_default_settings.categories_as_tabs.keep_only keeps only the refernce categories
This is going to allow to keep the icon definition (see #690 )
This commit is contained in:
parent
08e48718a3
commit
cfa62cc45f
5 changed files with 65 additions and 10 deletions
|
|
@ -3,6 +3,10 @@ use_default_settings:
|
|||
keep_only:
|
||||
- wikibooks
|
||||
- wikinews
|
||||
categories_as_tabs:
|
||||
keep_only:
|
||||
- general
|
||||
- images
|
||||
server:
|
||||
secret_key: "user_secret_key"
|
||||
bind_address: "0.0.0.0"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ use_default_settings:
|
|||
remove:
|
||||
- wikibooks
|
||||
- wikinews
|
||||
categories_as_tabs:
|
||||
remove:
|
||||
- files
|
||||
- social media
|
||||
server:
|
||||
secret_key: "user_secret_key"
|
||||
bind_address: "0.0.0.0"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@ use_default_settings:
|
|||
remove:
|
||||
- wikibooks
|
||||
- wikinews
|
||||
categories_as_tabs:
|
||||
remove:
|
||||
- files
|
||||
- social media
|
||||
categories_as_tabs:
|
||||
onions:
|
||||
server:
|
||||
secret_key: "user_secret_key"
|
||||
bind_address: "0.0.0.0"
|
||||
|
|
|
|||
|
|
@ -80,6 +80,11 @@ class TestUserSettings(SearxTestCase):
|
|||
self.assertNotIn('wikinews', engine_names)
|
||||
self.assertNotIn('wikibooks', engine_names)
|
||||
self.assertIn('wikipedia', engine_names)
|
||||
# check categories_as_tabs
|
||||
self.assertEqual(
|
||||
list(settings['categories_as_tabs'].keys()),
|
||||
['general', 'images', 'videos', 'news', 'map', 'music', 'it', 'science'],
|
||||
)
|
||||
|
||||
def test_user_settings_remove2(self):
|
||||
with patch.dict(
|
||||
|
|
@ -98,6 +103,11 @@ class TestUserSettings(SearxTestCase):
|
|||
self.assertEqual(wikipedia[0]['tokens'], ['secret_token'])
|
||||
newengine = list(filter(lambda engine: (engine.get('name')) == 'newengine', settings['engines']))
|
||||
self.assertEqual(newengine[0]['engine'], 'dummy')
|
||||
# check categories_as_tabs
|
||||
self.assertEqual(
|
||||
list(settings['categories_as_tabs'].keys()),
|
||||
['general', 'images', 'videos', 'news', 'map', 'music', 'it', 'science', 'onions'],
|
||||
)
|
||||
|
||||
def test_user_settings_keep_only(self):
|
||||
with patch.dict(
|
||||
|
|
@ -109,6 +119,8 @@ class TestUserSettings(SearxTestCase):
|
|||
self.assertEqual(engine_names, ['wikibooks', 'wikinews', 'wikipedia', 'newengine'])
|
||||
# wikipedia has been removed, then added again with the "engine" section of user_settings_keep_only.yml
|
||||
self.assertEqual(len(settings['engines'][2]), 1)
|
||||
# check categories_as_tabs
|
||||
self.assertEqual(list(settings['categories_as_tabs'].keys()), ['general', 'images'])
|
||||
|
||||
def test_custom_settings(self):
|
||||
with patch.dict(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue