diff options
author | Grant Lanham <contact@grantlanham.com> | 2024-10-05 16:10:56 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-10-15 08:10:52 +0200 |
commit | 3e87354f0ea62d5e2cf22bba136f0e5fdf71cb81 (patch) | |
tree | fe3004ab9f7e3ef56c29b6d1b84d392fade1319f /tests/unit/test_plugins.py | |
parent | d448def1a66afe9e0b702ac25ca921526a3f0ca2 (diff) | |
download | searxng-3e87354f0ea62d5e2cf22bba136f0e5fdf71cb81.tar.gz searxng-3e87354f0ea62d5e2cf22bba136f0e5fdf71cb81.zip |
[fix] float operations in calculator plugin
This patch adds an additional *isinstance* check within the ast parser to check
for float along with int, fixing the underlying issue.
Co-Authored: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'tests/unit/test_plugins.py')
-rw-r--r-- | tests/unit/test_plugins.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py index 6878228f3..86b5ce930 100644 --- a/tests/unit/test_plugins.py +++ b/tests/unit/test_plugins.py @@ -1,12 +1,15 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # pylint: disable=missing-module-docstring +import babel from mock import Mock from searx import plugins from tests import SearxTestCase def get_search_mock(query, **kwargs): + lang = kwargs.get("lang", "en-US") + kwargs["locale"] = babel.Locale.parse(lang, sep="-") return Mock(search_query=Mock(query=query, **kwargs), result_container=Mock(answers={})) |