text
stringlengths
0
5.92k
import os import tempfile from unittest.mock import patch import pytest from taipy.config import Config from taipy.config._config import _Config from taipy.config._serializer._toml_serializer import _TomlSerializer from taipy.config.checker._checker import _Checker from taipy.config.checker.issue_collector ...
import inspect import warnings import pytest from taipy.gui import Gui def test_no_ignore_file(gui: Gui): with warnings.catch_warnings(record=True): gui._set_frame(inspect.currentframe()) gui.run(run_server=False) client = gui._server.test_client() response = client....
import inspect import warnings import pytest from taipy.gui import Gui def test_ignore_file_found(gui: Gui): with warnings.catch_warnings(record=True): gui._set_frame(inspect.currentframe()) gui.run(run_server=False) client = gui._server.test_client() response = clie...
import inspect import time from urllib.request import urlopen from taipy.gui import Gui # this hangs in github def test_run_thread(gui: Gui, helpers): gui._set_frame(inspect.currentframe()) gui.add_page("page1", "# first page") gui.run(run_in_thread=True, run_browser=False) while not help...
import pytest from taipy.gui import Gui def test_add_shared_variables(gui: Gui): Gui.add_shared_variable("var1", "var2") assert isinstance(gui._Gui__shared_variables, list) assert len(gui._Gui__shared_variables) == 2 Gui.add_shared_variables("var1", "var2") assert len(gui._Gui__shared...
import json from taipy.gui.gui import Gui def test_multiple_instance(): gui1 = Gui("<|gui1|>") gui2 = Gui("<|gui2|>") gui1.run(run_server=False) gui2.run(run_server=False) client1 = gui1._server.test_client() client2 = gui2._server.test_client() assert_multiple_instance(client...
from taipy.gui.utils._variable_directory import _MODULE_NAME_MAP, _variable_decode, _variable_encode def test_variable_encode_decode(): assert _variable_encode("x", "module") == "x_TPMDL_0" assert _MODULE_NAME_MAP[0] == "module" assert _variable_decode("x_TPMDL_0") == ("x", "module") assert _va...
import inspect import warnings from taipy.gui import Gui, Markdown, State, navigate def test_navigate(gui: Gui, helpers): def navigate_to(state: State): navigate(state, "test") with warnings.catch_warnings(record=True): gui._set_frame(inspect.currentframe()) gui.add_page(...
import inspect import pandas as pd # type: ignore from taipy.gui import Gui def test_expression_text_control_str(gui: Gui, test_client, helpers): gui._bind_var_val("x", "Hello World!") md_string = "<|{x}|>" expected_list = ["<Field", 'dataType="str"', 'defaultValue="Hello World!"', "value={tp...
import numpy as np import pandas as pd from taipy.gui.data.decimator.lttb import LTTB from taipy.gui.data.decimator.minmax import MinMaxDecimator from taipy.gui.data.decimator.rdp import RDP from taipy.gui.data.decimator.scatter_decimator import ScatterDecimator from taipy.gui.data.utils import _df_data_filter ...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import inspect import pytest from taipy.gui import Gui, Markdown from .state_asset.page1 import get_a, md_page1, set_a def test_state(gui: Gui): a = 10 # noqa: F841 gui._set_frame(inspect.currentframe()) gui.add_page("page1", md_page1) gui.run(run_server=False, single_client=True) ...
import pytest from taipy.gui import Gui from taipy.gui.utils._locals_context import _LocalsContext def test_locals_context(gui: Gui): lc = _LocalsContext() gui.run(run_server=False) with gui.get_flask_app().app_context(): with pytest.raises(KeyError): lc.get_default() ...
import inspect from taipy.gui.utils.get_module_name import _get_module_name_from_frame, _get_module_name_from_imported_var x = 10 def test_get_module_name(): assert "tests.taipy.gui.gui_specific.test_get_module_name" == _get_module_name_from_frame(inspect.currentframe()) def test_get_module_name_im...
import inspect import os from pathlib import Path from taipy.gui import Gui def test_folder_pages_binding(gui: Gui): folder_path = f"{Path(Path(__file__).parent.resolve())}{os.path.sep}sample_assets" gui._set_frame(inspect.currentframe()) gui.add_pages(folder_path) gui.run(run_server=False...
import inspect import json import warnings from taipy.gui import Gui def test_render_route(gui: Gui): gui._set_frame(inspect.currentframe()) gui.add_page("page1", "# first page") gui.add_page("page2", "# second page") gui.run(run_server=False) with warnings.catch_warnings(record=True)...
import json import pandas as pd import pytest from taipy.gui import Gui from taipy.gui.utils import _TaipyContent def test__get_real_var_name(gui: Gui): res = gui._get_real_var_name("") assert isinstance(res, tuple) assert res[0] == "" assert res[1] == "" gui.run(run_server=False...
import json import warnings from types import SimpleNamespace from taipy.gui import Gui, Markdown def test_partial(gui: Gui): with warnings.catch_warnings(record=True): gui.add_partial(Markdown("#This is a partial")) gui.run(run_server=False) client = gui._server.test_client() ...
from taipy.gui import Gui, Markdown def test_variable_binding(helpers): """ Tests the binding of a few variables and a function """ def another_function(gui): pass x = 10 y = 20 z = "button label" gui = Gui() gui.add_page("test", Markdown("<|{x}|> | <|{y}|>...
from taipy.gui import Markdown a = 20 def get_a(state): return state.a def set_a(state, val): state.a = val md_page1 = Markdown( """ <|{a}|> """ )
import inspect import pytest from taipy.gui import Gui from taipy.gui.extension import Element, ElementLibrary class MyLibrary(ElementLibrary): def get_name(self) -> str: return "taipy_extension_example" def get_elements(self): return dict() def test_extension_no_config(gu...
import inspect import pytest from flask import g from taipy.gui import Gui def test_get_status(gui: Gui): gui.run(run_server=False) flask_client = gui._server.test_client() ret = flask_client.get("/taipy.status.json") assert ret.status_code == 200, f"status_code => {ret.status_code} != 2...
import inspect import io import pathlib import tempfile import pytest from taipy.gui import Gui from taipy.gui.data.data_scope import _DataScopes from taipy.gui.utils import _get_non_existent_file_path def test_file_upload_no_varname(gui: Gui, helpers): gui.run(run_server=False) flask_client =...
import pathlib import pytest from taipy.gui import Gui def test_image_path_not_found(gui: Gui, helpers): gui.run(run_server=False) flask_client = gui._server.test_client() # Get the jsx once so that the page will be evaluated -> variable will be registered sid = helpers.create_scope_and_g...
import inspect import pytest from taipy.gui import Gui def test_user_content_without_callback(gui: Gui, helpers): gui.run(run_server=False, single_client=True) flask_client = gui._server.test_client() with pytest.warns(UserWarning): ret = flask_client.get(gui._get_user_content_url("pa...
import inspect from taipy.gui import Gui, Markdown from taipy.gui.data.data_scope import _DataScopes def test_sending_messages_in_group(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_...
import inspect import logging import pathlib import pytest from taipy.gui import Gui, download def test_download_file(gui: Gui, helpers): def do_something(state, id): download(state, (pathlib.Path(__file__).parent.parent.parent / "resources" / "taipan.jpg")) # Bind a page so that the f...
import inspect from taipy.gui import Gui, Markdown def ws_u_assert_template(gui: Gui, helpers, value_before_update, value_after_update, payload): # Bind test variable var = value_before_update # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) # Bind a page so that...
import inspect from taipy.gui import Gui, Markdown def test_du_table_data_fetched(gui: Gui, helpers, csvdata): # Bind test variables csvdata = csvdata # set gui frame gui._set_frame(inspect.currentframe()) Gui._set_timezone("UTC") # Bind a page so that the variable will be eval...
import inspect import pytest from taipy.gui import Gui, Markdown def test_default_on_change(gui: Gui, helpers): st = {"d": False} def on_change(state, var, value): st["d"] = True x = 10 # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add...
import inspect import pytest from taipy.gui import Gui, Markdown def test_ru_selector(gui: Gui, helpers, csvdata): # Bind test variables selected_val = ["value1", "value2"] # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) # Bind a page so that the variable wil...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import inspect import pytest from taipy.gui import Gui, Markdown def test_broadcast(gui: Gui, helpers): # Bind test variables selected_val = ["value1", "value2"] # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) # Bind a page so that the variable will be evalua...
import inspect import time from taipy.gui import Gui, Markdown def test_a_button_pressed(gui: Gui, helpers): def do_something(state, id): state.x = state.x + 10 state.text = "a random text" x = 10 # noqa: F841 text = "hi" # noqa: F841 # set gui frame gui._set_fram...
import inspect import warnings from flask import g from taipy.gui import Gui from taipy.gui.utils.types import _TaipyNumber def test_unbind_variable_in_expression(gui: Gui, helpers): gui.run(run_server=False, single_client=True) with warnings.catch_warnings(record=True) as records: with ...
import inspect import pytest from taipy.gui.gui import Gui from taipy.gui.utils import _MapDict def test_map_dict(): d = {"a": 1, "b": 2, "c": 3} md = _MapDict(d) md_copy = _MapDict(d).copy() assert len(md) == 3 assert md.__getitem__("a") == d["a"] md.__setitem__("a", 4) a...
import pathlib import tempfile from taipy.gui import Gui from taipy.gui.utils import _get_non_existent_file_path def test_empty_file_name(gui: Gui, helpers): assert _get_non_existent_file_path(pathlib.Path(tempfile.gettempdir()), "").name def test_non_existent_file(gui: Gui, helpers): assert no...
import warnings import pytest from taipy.gui.utils.date import _string_to_date from taipy.gui.utils.types import _TaipyBase, _TaipyBool, _TaipyDate, _TaipyNumber def test_taipy_base(): tb = _TaipyBase("value", "hash") assert tb.get() == "value" assert tb.get_name() == "hash" tb.set("a ...
import inspect from time import sleep import pytest from taipy.gui import Gui, State, invoke_long_callback def test_long_callback(gui: Gui): status = None # noqa: F841 def heavy_function(delay=1): sleep(delay) def heavy_function_with_exception(delay=1): sleep(delay) ...
import inspect from flask import g from taipy.gui import Gui, Markdown, get_state_id def test_get_state_id(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_page("test", Markdown("<|He...
import inspect from flask import g from taipy.gui import Gui, Markdown, State, download def test_download(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 def on_download_action(state: State): pass # set gui frame gui._set_frame(inspect....
import inspect from flask import g from taipy.gui import Gui, Markdown, navigate def test_navigate(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_page("test", Markdown("<|Hello {nam...
import inspect from flask import g from taipy.gui import Gui, Markdown, State, invoke_callback def test_invoke_callback(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 val = 1 # noqa: F841 def user_callback(state: State): state.val = 10 ...
import inspect from flask import g from taipy.gui import Gui, Markdown, hold_control def test_hold_control(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_page("test", Markdown("<|He...
import inspect from flask import g from taipy.gui import Gui, Markdown, resume_control def test_resume_control(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_page("test", Markdown("...
import inspect from flask import g from taipy.gui import Gui, Markdown, notify def test_notify(gui: Gui, helpers): name = "World!" # noqa: F841 btn_id = "button1" # noqa: F841 # set gui frame gui._set_frame(inspect.currentframe()) gui.add_page("test", Markdown("<|Hello {name}|b...
import contextlib import time from urllib.request import urlopen import pytest from testbook import testbook @pytest.mark.filterwarnings("ignore::RuntimeWarning") @testbook("tests/gui/notebook/simple_gui.ipynb") def test_notebook_simple_gui(tb, helpers): tb.execute_cell("import") tb.execute_cell(...
from taipy.gui import Gui, Markdown
import inspect from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_redirect(page: "Page", gui: Gui, helpers): page_md = """ <|Redirect Successfully|id=text1|> """ gui._s...
import pytest @pytest.fixture(scope="session") def browser_context_args(browser_context_args, e2e_port, e2e_base_url): return { **browser_context_args, "base_url": f"http://127.0.0.1:{e2e_port}{e2e_base_url}", "timezone_id": "Europe/Paris", } @pytest.fixture(scope="functi...
import inspect import re from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from playwright.sync_api import expect from taipy.gui import Gui @pytest.mark.teste2e def test_navbar_navigate(page: "Page", gui: Gui, helpers): gui....
import inspect from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui from taipy.gui.utils.date import _string_to_date @pytest.mark.teste2e def test_timzone_specified_1(page: "Page", gui: Gui, helpers): _time...
import inspect from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_accessor_json(page: "Page", gui: Gui, csvdata, helpers): table_data = csvdata # noqa: F841 gui._set_fra...
import inspect from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_theme_light(page: "Page", gui: Gui, helpers): page_md = """ <|Just a page|id=text1|> """ gui._set_fram...
import inspect from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_margin_1(page: "Page", gui: Gui, helpers): page_md = """ <|Just a page|id=text1|> """ gui._set_frame(i...
import inspect import os import time from importlib import util from pathlib import Path from urllib.request import urlopen import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui, Html from taipy.gui.server import _Server @pytest.mark.te...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_markdown_render_with_style(page: "Page", gui: Gui, helpers): markdown_content = """ <|Hey|id...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui if util.find_spec("playwright"): from playwright._impl._page import Page from .assets2_class_scopes.page1 import Page1 from .assets2_class_scopes.page2 import Page2 def helpers_assert_value(page, s1...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui if util.find_spec("playwright"): from playwright._impl._page import Page from .assets.page1 import page as page1 from .assets.page2 import page as page2 from .assets.page3 import page as page3 @pyt...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui, Markdown if util.find_spec("playwright"): from playwright._impl._page import Page from .assets3.page1 import page as page1 def helpers_assert_text(page, s): val1 = page.query_selector("#t1").in...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui, Markdown if util.find_spec("playwright"): from playwright._impl._page import Page from .assets3_class_scopes.page1 import Page1 def helpers_assert_text(page, s): val1 = page.query_selector("#t1...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui if util.find_spec("playwright"): from playwright._impl._page import Page from .assets4.page1 import page as page1 from .assets4.page1 import reset_d @pytest.mark.timeout(300) @pytest.mark.teste2e ...
import inspect import logging from importlib import util import pytest from taipy.gui import Gui if util.find_spec("playwright"): from playwright._impl._page import Page from .assets2.page1 import page as page1 from .assets2.page2 import page as page2 def helpers_assert_value(page, s1, s2, v1):...
from taipy.gui import Markdown, Page class Page1(Page): def __init__(self): self.operand_2 = 0 super().__init__() def create_page(self): return Markdown("page1.md") def reset(state): state.operand_2 = 0
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from taipy.gui import Markdown, Page class Page2(Page): def __init__(self): self.operand_2 = 0 super().__init__() def create_page(self): return Markdown("page2.md")
from taipy.gui import Markdown, Page class Page1(Page): def create_page(self): return Markdown( """ <|{n}|id=t1|> """ )
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from taipy.gui import Markdown x = 10 y = 20 def on_change(state, var, val): if var == "x": state.y = val * 3 page = Markdown( """ x = <|{x}|id=x1|> x * 2 = <|{x*2}|id=x2|> x number: <|{x}|number|id=xinput|> y = <|{y}|id=y1|> y * 2 = <|{y*2}|id=y2|> """ )
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from taipy.gui import Markdown from .page1 import x as y from .page1 import y as x def on_change(state, var, val): if var == "x": state.y = val * 5 page = Markdown( """ y = <|{x}|id=x1|> y * 2 = <|{x*2}|id=x2|> y number: <|{x}|number|id=xinput|> x = <|{y}|id=y1|> x * 2 = <|...
from taipy.gui import Markdown x = 50 page = Markdown( """ <|{x}|id=x1|> x * 2 = <|{x*2}|id=x2|> <|{x}|number|id=xinput|> """ )
from taipy.gui import Markdown page = Markdown( """ # Page1 - Add Operand 1: <|{operand_1}|slider|id=s1|> Operand 2: <|{operand_2}|slider|id=s2|> Operand 1 + Operand 2 = <|{operand_1 + operand_2}|id=v1|> """ ) operand_2 = 0
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from taipy.gui import Markdown page = Markdown( """ # Page2 - Multiply Operand 1: <|{operand_1}|slider|id=s1|> Operand 2: <|{operand_2}|slider|id=s2|> Operand 1 * Operand 2 = <|{operand_1 * operand_2}|id=v1|> """ ) operand_2 = 0
from taipy.gui import Markdown d = 20 def reset_d(state): state.d = d # a page = Markdown( """ <|{d}|text|id=t1|> <|{d}|number|id=n1|> """ )
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from taipy.gui import Markdown page = Markdown( """ <|{n}|id=t1|> """ )
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_slider_action(page: "Page", gui: Gui, helpers): page_md = """ <|{x}|id=text1|> <|{x}|slid...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_button_action(page: "Page", gui: Gui, helpers): page_md = """ <|{x}|id=text1|> <|Action|b...
import inspect import time from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui, State @pytest.mark.teste2e def test_selector_action(page: "Page", gui: Gui, helpers): page_md = """ <|{x}|selector|lov=Item ...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui def edit_and_assert_page(page: "Page"): assert_input(page, "0") page.fill("#input2 input", "20") function_evalua...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_dict(page: "Page", gui: Gui, helpers): page_md = """ <|{a_dict[a_key]}|input|id=inp1|> <|{a...
import inspect import logging from importlib import util import pytest if util.find_spec("playwright"): from playwright._impl._page import Page from taipy.gui import Gui @pytest.mark.teste2e def test_text_edit(page: "Page", gui: Gui, helpers): page_md = """ <|{x}|text|id=text1|> <|{x}|inp...
from importlib import util from taipy.gui import Gui from taipy.gui.data.array_dict_data_accessor import _ArrayDictDataAccessor from taipy.gui.data.data_format import _DataFormat from taipy.gui.utils import _MapDict an_array = [1, 2, 3] def test_simple_data(gui: Gui, helpers): accessor = _ArrayDictDa...
import inspect import taipy.gui.builder as tgb from taipy.gui import Gui def test_slider_builder(gui: Gui, test_client, helpers): gui._bind_var_val("x", 10) with tgb.Page(frame=None) as page: tgb.slider(value="{x}") expected_list = [ "<Slider", 'updateVarName="_TpN_tpe...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import taipy.gui.builder as tgb from taipy.gui import Gui def test_selector_builder_1(gui: Gui, test_client, helpers): gui._bind_var_val("selected_val", ["l1", "l2"]) gui._bind_var_val("selector_properties", {"lov": [("l1", "v1"), ("l2", "v2"), ("l3", "v3")], "filter": True}) with tgb.Page(frame=No...
import inspect import taipy.gui.builder as tgb from taipy.gui import Gui def test_input_builder(gui: Gui, helpers): x = "Hello World!" # noqa: F841 gui._set_frame(inspect.currentframe()) with tgb.Page(frame=None) as page: tgb.input(value="{x}") expected_list = [ "<Input",...
import taipy.gui.builder as tgb from taipy.gui import Gui def test_tree_builder(gui: Gui, test_client, helpers): gui._bind_var_val("value", "Item 1") with tgb.Page(frame=None) as page: tgb.tree(value="{value}", lov="Item 1;Item 2;Item 3") expected_list = [ "<TreeView", 'd...
import taipy.gui.builder as tgb from taipy.gui import Gui def test_expandable_builder_1(gui: Gui, helpers): with tgb.expandable(title="Expandable section", expanded=False) as content: tgb.text(value="This is an expandable section") expected_list = [ "<Expandable", "expanded={f...
import inspect import taipy.gui.builder as tgb from taipy.gui import Gui def test_table_builder_1(gui: Gui, helpers, csvdata): with tgb.Page(frame=None) as page: tgb.table( data="{csvdata}", page_size=10, page_size_options=[10, 30, 100], columns...
import os import pathlib from importlib import util import taipy.gui.builder as tgb from taipy.gui import Gui def test_image_url_builder(gui: Gui, test_client, helpers): gui._bind_var_val("content", "some_url") with tgb.Page(frame=None) as page: tgb.image(content="{content}") expected...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
import inspect import taipy.gui.builder as tgb from taipy.gui import Gui def test_status_builder(gui: Gui, helpers): status = [{"status": "info", "message": "Info Message"}] # noqa: F841 with tgb.Page(frame=None) as page: tgb.status(value="{status}") expected_list = [ "<Status...
import taipy.gui.builder as tgb from taipy.gui import Gui def test_toggle_builder(gui: Gui, helpers): with tgb.Page(frame=None) as page: tgb.toggle(theme=True) expected_list = ["<Toggle", 'kind="theme"', 'unselectedValue=""'] helpers.test_control_builder(gui, page, expected_list) def ...
import taipy.gui.builder as tgb from taipy.gui import Gui def test_pane_builder(gui: Gui, test_client, helpers): gui._bind_var_val("show_pane", False) with tgb.Page(frame=None) as page: with tgb.pane(open="{show_pane}"): tgb.text(value="This is a Pane") expected_list = [ ...