text stringlengths 0 105k |
|---|
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... |
import inspect from datetime import datetime from importlib import util import pandas # type: ignore from flask import g from taipy.gui import Gui from taipy.gui.data.data_format import _DataFormat from taipy.gui.data.decimator import ScatterDecimator from taipy.gui.data.pandas_data_accessor import _Pandas... |
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 = [ ... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_text_builder_1(gui: Gui, test_client, helpers): gui._bind_var_val("x", 10) with tgb.Page(frame=None) as page: tgb.text(value="{x}") expected_list = ["<Field", 'dataType="int"', 'defaultValue="10"', "value={tpec_TpExPr_x_TPM... |
import os import pathlib from importlib import util import taipy.gui.builder as tgb from taipy.gui import Gui def test_file_download_url_builder(gui: Gui, test_client, helpers): gui._bind_var_val("content", "some_url") with tgb.Page(frame=None) as page: tgb.file_download(content="{content}... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_file_selector_builder(gui: Gui, test_client, helpers): gui._bind_var_val("content", None) with tgb.Page(frame=None) as page: tgb.file_selector(content="{content}", label="label", on_action="action") expected_list = [ ... |
import inspect import taipy.gui.builder as tgb from taipy.gui import Gui, Markdown def test_dialog_builder_1(gui: Gui, helpers): dialog_open = False # noqa: F841 gui._set_frame(inspect.currentframe()) with tgb.Page(frame=None) as page: tgb.dialog(title="This is a Dialog", open="{dialog... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_menu_builder(gui: Gui, test_client, helpers): gui._bind_var_val("lov", ["Item 1", "Item 2", "Item 3", "Item 4"]) with tgb.Page(frame=None) as page: tgb.menu(lov="{lov}", on_action="on_menu_action") expected_list = [ ... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_layout_builder_1(gui: Gui, helpers): with tgb.Page(frame=None) as page: with tgb.layout(columns="1 1", gap="1rem"): tgb.text(value="This is a layout section") expected_list = ["<Layout", 'columns="1 1', 'gap="1rem"'... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_number_builder_1(gui: Gui, helpers): with tgb.Page(frame=None) as page: tgb.number(value="10") expected_list = ["<Input", 'value="10"', 'type="number"'] helpers.test_control_builder(gui, page, expected_list) def test_n... |
from datetime import datetime import taipy.gui.builder as tgb from taipy.gui import Gui def test_date_builder_1(gui: Gui, test_client, helpers): gui._bind_var_val("date", datetime.strptime("15 Dec 2020", "%d %b %Y")) with tgb.Page(frame=None) as page: tgb.date(id="date", date="{date}") ... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_indicator_builder(gui: Gui, test_client, helpers): gui._bind_var_val("val", 15) with tgb.Page(frame=None) as page: tgb.indicator(display=12, value="{val}", min=1, max=20, format="%.2f") expected_list = [ "<Indicato... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_navbar_builder(gui: Gui, test_client, helpers): gui._bind_var_val( "navlov", [ ("/page1", "Page 1"), ("/page2", "Page 2"), ("/page3", "Page 3"), ("/page4", "Page 4"), ... |
import datetime import inspect import random import typing as t import taipy.gui.builder as tgb from taipy.gui import Gui def test_chart_builder_1(gui: Gui, helpers, csvdata): selected_indices = [14258] # noqa: F841 subplot_layout = { # noqa: F841 "grid": {"rows": 1, "columns": 2, "subp... |
import taipy.gui.builder as tgb from taipy.gui import Gui def test_part_builder_1(gui: Gui, helpers): with tgb.Page(frame=None) as page: with tgb.part(class_name="class1"): tgb.text(value="This is a part") expected_list = ["<Part", "This is a part"] helpers.test_control_builde... |
import inspect from taipy.gui import Gui def test_slider_md(gui: Gui, test_client, helpers): gui._bind_var_val("x", 10) md_string = "<|{x}|slider|>" expected_list = [ "<Slider", 'updateVarName="_TpN_tpec_TpExPr_x_TPMDL_0', "defaultValue={10}", "value={_TpN_tpec... |
# # 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 Gui def test_selector_md_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}) md_string = "<|{selected_val}|selector|properties=selector_p... |
import inspect from taipy.gui import Gui def test_input_md(gui: Gui, helpers): x = "Hello World!" # noqa: F841 gui._set_frame(inspect.currentframe()) md_string = "<|{x}|input|>" expected_list = [ "<Input", 'updateVarName="tpec_TpExPr_x_TPMDL_0"', 'defaultValue="He... |
from taipy.gui import Gui def test_tree_md(gui: Gui, test_client, helpers): gui._bind_var_val("value", "Item 1") md_string = "<|{value}|tree|lov=Item 1;Item 2;Item 3|>" expected_list = [ "<TreeView", 'defaultLov="["Item 1", "Item 2", "Item 3"]"', ... |
from taipy.gui import Gui def test_expandable_md_1(gui: Gui, helpers): md_string = """ <|Expandable section|expandable|not expanded| # This is an expandable section |> """ expected_list = [ "<Expandable", "expanded={false}", 'title="Expandable section"', "<h1", ... |
import inspect from taipy.gui import Gui def test_table_md_1(gui: Gui, helpers, csvdata): md_string = "<|{csvdata}|table|page_size=10|page_size_options=10;30;100|columns=Day;Entity;Code;Daily hospital occupancy|date_format=eee dd MMM yyyy|>" expected_list = [ "<Table", 'defaultColumn... |
from datetime import datetime from taipy.gui import Gui def test_date_range_md_1(gui: Gui, test_client, helpers): gui._bind_var_val( "dates", [datetime.strptime("15 Dec 2020", "%d %b %Y"), datetime.strptime("31 Dec 2020", "%d %b %Y")] ) md_string = "<|{dates}|date_range|>" expected_... |
import os import pathlib from importlib import util from taipy.gui import Gui def test_image_url_md(gui: Gui, test_client, helpers): gui._bind_var_val("content", "some_url") md_string = "<|{content}|image|>" expected_list = [ "<Image", "content={_TpCi_tpec_TpExPr_content_TPMDL... |
# # 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 from taipy.gui import Gui def test_status_md(gui: Gui, helpers): status = [{"status": "info", "message": "Info Message"}] # noqa: F841 md_string = "<|{status}|status|>" expected_list = [ "<Status", 'defaultValue="[{"status": "info", "... |
from taipy.gui import Gui def test_toggle_md(gui: Gui, helpers): md_string = "<|toggle|theme|>" expected_list = ["<Toggle", 'kind="theme"', 'unselectedValue=""'] helpers.test_control_md(gui, md_string, expected_list) def test_toggle_allow_unselected_md(gui: Gui, helpers): md_string = "<|to... |
from taipy.gui import Gui def test_pane_md(gui: Gui, test_client, helpers): gui._bind_var_val("show_pane", False) md_string = """ <|{show_pane}|pane|not persistent| # This is a Pane |> """ expected_list = [ "<Pane", 'anchor="left"', 'updateVarName="_TpB_tpec_TpExPr_sho... |
from taipy.gui import Gui def test_text_md_1(gui: Gui, test_client, helpers): gui._bind_var_val("x", 10) md_string = "<|{x}|>" expected_list = ["<Field", 'dataType="int"', 'defaultValue="10"', "value={tpec_TpExPr_x_TPMDL_0}"] helpers.test_control_md(gui, md_string, expected_list) def test_... |
import os import pathlib from importlib import util from taipy.gui import Gui def test_file_download_url_md(gui: Gui, test_client, helpers): gui._bind_var_val("content", "some_url") md_string = "<|{content}|file_download|>" expected_list = [ "<FileDownload", "content={_TpC_tpe... |
from taipy.gui import Gui def test_file_selector_md(gui: Gui, test_client, helpers): gui._bind_var_val("content", None) md_string = "<|{content}|file_selector|label=label|on_action=action|>" expected_list = [ "<FileSelector", 'updateVarName="tpec_TpExPr_content_TPMDL_0"', ... |
from taipy.gui import Gui def test_content_md(gui: Gui, helpers): md_string = "<|content|>" expected_list = ["<PageContent"] helpers.test_control_md(gui, md_string, expected_list) def test_content_html(gui: Gui, helpers): html_string = "<taipy:content />" expected_list = ["<PageConten... |
import inspect from taipy.gui import Gui, Markdown def test_dialog_md_1(gui: Gui, helpers): dialog_open = False # noqa: F841 gui._set_frame(inspect.currentframe()) md_string = "<|dialog|title=This is a Dialog|open={dialog_open}|page=page_test|on_action=validate_action|>" expected_list = [ ... |
from taipy.gui import Gui def test_menu_md(gui: Gui, test_client, helpers): gui._bind_var_val("lov", ["Item 1", "Item 2", "Item 3", "Item 4"]) md_string = "<|menu|lov={lov}|on_action=on_menu_action|>" expected_list = [ "<MenuCtl", 'libClassName="taipy-menu"', 'defaultLov="... |
from taipy.gui import Gui def test_layout_md_1(gui: Gui, helpers): md_string = """ <|layout|columns=1 1|gap=1rem| # This is a layout section |> """ expected_list = ["<Layout", 'columns="1 1', 'gap="1rem"', "<h1", "This is a layout section"] helpers.test_control_md(gui, md_string, expected_list) ... |
from taipy.gui import Gui def test_number_md_1(gui: Gui, helpers): md_string = "<|10|number|>" expected_list = ["<Input", 'value="10"', 'type="number"'] helpers.test_control_md(gui, md_string, expected_list) def test_number_md_2(gui: Gui, test_client, helpers): gui._bind_var_val("x", "10")... |
from datetime import datetime from taipy.gui import Gui def test_date_md_1(gui: Gui, test_client, helpers): gui._bind_var_val("date", datetime.strptime("15 Dec 2020", "%d %b %Y")) md_string = "<|{date}|date|>" expected_list = [ "<DateSelector", 'defaultDate="2020-12-', ... |
from taipy.gui import Gui def test_indicator_md(gui: Gui, test_client, helpers): gui._bind_var_val("val", 15) md_string = "<|12|indicator|value={val}|min=1|max=20|format=%.2f|>" expected_list = [ "<Indicator", 'libClassName="taipy-indicator"', "defaultValue={15}", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.