From 3e87354f0ea62d5e2cf22bba136f0e5fdf71cb81 Mon Sep 17 00:00:00 2001 From: Grant Lanham Date: Sat, 5 Oct 2024 16:10:56 +0200 Subject: [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 --- tests/unit/test_plugins.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/unit/test_plugins.py') 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={})) -- cgit v1.2.3-54-g00ecf