Skip to content

Commit

Permalink
fab's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Nov 14, 2024
1 parent 852d838 commit 12a9f5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/gui/gui_specific/test_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
from taipy.gui.utils._evaluator import _Evaluator


def _create_chart(x):
def _identity(x):
return x

def test_evaluate_expr_lambda_from_element(gui: Gui, test_client, helpers):
gui._Gui__evaluator = _Evaluator({}, []) # type: ignore[attr-defined]
gui._Gui__locals_context.add("a_module", {"create_chart": _create_chart}) # type: ignore[attr-defined]
gui._Gui__locals_context.add("a_module", {"identity": _identity}) # type: ignore[attr-defined]
with gui._set_locals_context("a_module"):
evaluated_expr: str = gui._evaluate_expr("lambda x: create_chart(x)", lambda_expr=True)
evaluated_expr: str = gui._evaluate_expr("lambda x: identity(x)", lambda_expr=True)
assert evaluated_expr.startswith("__lambda_")
assert evaluated_expr.endswith("_TPMDL_0")

0 comments on commit 12a9f5f

Please sign in to comment.