mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[enh] Allowing using multiple autocomplete engines
This commit is contained in:
parent
0fb3f0e4ae
commit
e1d3389047
6 changed files with 53 additions and 12 deletions
|
|
@ -66,6 +66,14 @@ class TestSettings(SearxTestCase): # pylint: disable=missing-class-docstring
|
|||
|
||||
# multiple choice settings
|
||||
|
||||
def test_multiple_setting_default_value_invalid_commma_seperated(self):
|
||||
with self.assertRaises(ValidationException):
|
||||
MultipleChoiceSetting("duckduckgo,doesnotexist", choices=['duckduckgo', 'stract', 'qwant'])
|
||||
|
||||
def test_multiple_setting_default_value_valid_commma_seperated(self):
|
||||
setting = MultipleChoiceSetting("duckduckgo,stract", choices=['duckduckgo', 'stract', 'qwant'])
|
||||
self.assertEqual(setting.get_value(), ['duckduckgo', 'stract'])
|
||||
|
||||
def test_multiple_setting_invalid_default_value(self):
|
||||
with self.assertRaises(ValidationException):
|
||||
MultipleChoiceSetting(['3', '4'], choices=['0', '1', '2'])
|
||||
|
|
|
|||
|
|
@ -121,3 +121,4 @@ class TestUserSettings(SearxTestCase): # pylint: disable=missing-class-docstrin
|
|||
self.assertEqual(settings['server']['secret_key'], "user_settings_secret")
|
||||
engine_names = [engine['name'] for engine in settings['engines']]
|
||||
self.assertEqual(engine_names, ['wikidata', 'wikibooks', 'wikinews', 'wikiquote'])
|
||||
self.assertIsInstance(settings['search']['autocomplete'], (list, str))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue