diff options
author | Martin Fischer <martin@push-f.com> | 2022-01-06 18:45:50 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-01-06 18:56:02 +0100 |
commit | 180d4d068b4c629ab99876b55046f98455b88149 (patch) | |
tree | ec01ec41285e30ea11b9f0cd48a851d9279b0ba3 /tests | |
parent | 56fbf221082bce439fef6e975058367cf4d2ce79 (diff) | |
download | searxng-180d4d068b4c629ab99876b55046f98455b88149.tar.gz searxng-180d4d068b4c629ab99876b55046f98455b88149.zip |
[refactor] refactor SwitchableSetting
The previous implementation used two hash sets and a list.
... that's not necessary ... a single hash map suffices.
And it's also less error prone ... because the previous data structure
allowed a setting to be enabled and disabled at the same time.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_preferences.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test_preferences.py b/tests/unit/test_preferences.py index 18323940b..a69c45178 100644 --- a/tests/unit/test_preferences.py +++ b/tests/unit/test_preferences.py @@ -105,14 +105,14 @@ class TestSettings(SearxTestCase): plugin1 = PluginStub('plugin1', True) plugin2 = PluginStub('plugin2', True) setting = PluginsSetting(['3'], plugins=[plugin1, plugin2]) - self.assertEqual(setting.get_enabled(), set(['plugin1', 'plugin2'])) + self.assertEqual(set(setting.get_enabled()), set(['plugin1', 'plugin2'])) def test_plugins_setting_few_default_enabled(self): plugin1 = PluginStub('plugin1', True) plugin2 = PluginStub('plugin2', False) plugin3 = PluginStub('plugin3', True) setting = PluginsSetting('name', plugins=[plugin1, plugin2, plugin3]) - self.assertEqual(setting.get_enabled(), set(['plugin1', 'plugin3'])) + self.assertEqual(set(setting.get_enabled()), set(['plugin1', 'plugin3'])) class TestPreferences(SearxTestCase): |