mirror of
https://github.com/searxng/searxng.git
synced 2025-07-19 03:09:25 +02:00
[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>
This commit is contained in:
parent
d448def1a6
commit
3e87354f0e
4 changed files with 51 additions and 16 deletions
|
@ -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={}))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue