text
stringlengths
0
5.92k
"""The setup script.""" import json import os import sysconfig from importlib.util import find_spec from pathlib import Path from setuptools import find_namespace_packages, find_packages, setup from setuptools.command.build_py import build_py with open("README.md", "rb") as readme_file: readme = re...
import re import sys repo_name = sys.argv[1] branch_name = sys.argv[2] # Regex pattern <img\s+([^>]*?)(?<!['"])(?<!\/)src\s*=\s*(['"])(?!http|\/)(.*?)\2([^>]*?)> pattern = re.compile("<img\\s+([^>]*?)(?<!['\"])(?<!\\/)src\\s*=\\s*(['\"])(?!http|\\/)(.*?)\\2([^>]*?)>") replacement = r'<img \1src="https://raw.git...
# ############################################################ # Generate Python interface definition files # ############################################################ from src.taipy.gui.config import Config import json import os import typing as t # #########################################################...
import pytest def pytest_addoption(parser): parser.addoption("--e2e-base-url", action="store", default="/", help="base url for e2e testing") parser.addoption("--e2e-port", action="store", default="5000", help="port for e2e testing") @pytest.fixture(scope="session") def e2e_base_url(request): r...
from unittest import mock from src.taipy._run import _run from taipy.core import Core from taipy.gui import Gui from taipy.rest import Rest @mock.patch("taipy.gui.Gui.run") def test_run_pass_with_gui(gui_run): _run(Gui()) gui_run.assert_called_once() @mock.patch("taipy.core.Core.run") def te...
"""Unit test package for taipy."""
from unittest.mock import patch import pytest from src.taipy.core import Core from src.taipy.core._orchestrator._dispatcher import _DevelopmentJobDispatcher, _StandaloneJobDispatcher from src.taipy.core._orchestrator._orchestrator import _Orchestrator from src.taipy.core._orchestrator._orchestrator_factory imp...
# # 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 json import os from datetime import datetime, timedelta import pytest from src.taipy.core._repository._decoder import _Decoder from src.taipy.core._repository._encoder import _Encoder @pytest.fixture(scope="function", autouse=True) def create_and_delete_json_file(): test_json_file = { ...
import src.taipy.core.taipy as tp from src.taipy.core.config import Config def test_no_special_characters(): scenario_config = Config.configure_scenario("scenario_1") scenario = tp.create_scenario(scenario_config, name="martin") assert scenario.name == "martin" scenarios = tp.get_scenarios()...
# # 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 json import os import pathlib import shutil import pytest from src.taipy.core.exceptions.exceptions import InvalidExportPath from taipy.config.config import Config from .mocks import MockConverter, MockFSRepository, MockModel, MockObj, MockSQLRepository class TestRepositoriesStorage: @pyte...
import dataclasses import pathlib from dataclasses import dataclass from typing import Any, Dict, Optional from sqlalchemy import Column, String, Table from sqlalchemy.dialects import sqlite from sqlalchemy.orm import declarative_base, registry from sqlalchemy.schema import CreateTable from src.taipy.core._...
import pytest from taipy.config.config import Config def test_job_config(): assert Config.job_config.mode == "development" job_c = Config.configure_job_executions(mode="standalone", max_nb_of_workers=2) assert job_c.mode == "standalone" assert job_c.max_nb_of_workers == 2 assert Con...
from taipy.config.config import Config def migrate_pickle_path(dn): dn.path = "s1.pkl" def migrate_skippable(task): task.skippable = True def test_migration_config(): assert Config.migration_functions.migration_fcts == {} data_nodes1 = Config.configure_data_node("data_nodes1", "pick...
# # 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...
from unittest.mock import patch import pytest from src.taipy.core._init_version import _read_version from src.taipy.core.config.core_section import CoreSection from src.taipy.core.exceptions import ConfigCoreVersionMismatched from taipy.config.config import Config from tests.core.utils.named_temporary_file im...
from datetime import timedelta from taipy.config import Config from taipy.config.common.scope import Scope class TestConfig: def test_configure_csv_data_node(self): a, b, c, d, e, f = "foo", "path", True, "numpy", Scope.SCENARIO, timedelta(1) Config.configure_csv_data_node(a, b, c, d, e,...
from unittest.mock import patch from src.taipy.core import Core from src.taipy.core._version._version_manager_factory import _VersionManagerFactory from taipy.config import Config from tests.core.utils.named_temporary_file import NamedTemporaryFile def test_core_section(): with patch("sys.argv", ["prog"...
from unittest.mock import patch import pytest from src.taipy.core import Core from src.taipy.core._version._version_manager import _VersionManager from src.taipy.core.config import MigrationConfig from taipy.config.config import Config def mock_func(): pass def test_check_if_entity_property_key_...
import pytest from taipy.config.checker.issue_collector import IssueCollector from taipy.config.config import Config class TestConfigIdChecker: def test_check_standalone_mode(self, caplog): Config._collector = IssueCollector() Config.check() assert len(Config._collector.errors) ...
# # 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 pytest from src.taipy.core.config.job_config import JobConfig from taipy.config.checker.issue_collector import IssueCollector from taipy.config.config import Config class TestJobConfigChecker: def test_check_standalone_mode(self, caplog): Config._collector = IssueCollector() Conf...
from src.taipy.core.config.checkers._core_section_checker import _CoreSectionChecker from src.taipy.core.config.core_section import CoreSection from taipy.config import Config from taipy.config.checker.issue_collector import IssueCollector class TestCoreSectionChecker: _CoreSectionChecker._ACCEPTED_REPOSIT...
# # 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 queue import SimpleQueue from src.taipy.core import taipy as tp from src.taipy.core.notification.core_event_consumer import CoreEventConsumerBase from src.taipy.core.notification.event import Event, EventEntityType, EventOperation from src.taipy.core.notification.notifier import Notifier from taipy.config i...
from queue import SimpleQueue from src.taipy.core.notification import EventEntityType, EventOperation from src.taipy.core.notification._registration import _Registration from src.taipy.core.notification._topic import _Topic def test_create_registration(): registration_0 = _Registration() assert is...
# # 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 os import pytest from src.taipy.core.cycle._cycle_fs_repository import _CycleFSRepository from src.taipy.core.cycle._cycle_sql_repository import _CycleSQLRepository from src.taipy.core.cycle.cycle import Cycle, CycleId from src.taipy.core.exceptions import ModelNotFound class TestCycleRepositories:...
# # 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 dataclasses import pathlib from dataclasses import dataclass from typing import Any, Dict, Iterable, List, Optional, Union from src.taipy.core._manager._manager import _Manager from src.taipy.core._repository._abstract_converter import _AbstractConverter from src.taipy.core._repository._abstract_reposito...
class NotifyMock: """ A shared class for testing notification on jobStatus of sequence level and scenario level "entity" can be understood as either "scenario" or "sequence". """ def __init__(self, entity): self.scenario = entity self.nb_called = 0 self.__name__...
def assert_true_after_time(assertion, msg=None, time=120): from datetime import datetime from time import sleep loops = 0 start = datetime.now() while (datetime.now() - start).seconds < time: sleep(1) # Limit CPU usage try: if assertion(): re...
import os import tempfile class NamedTemporaryFile: def __init__(self, content=None): with tempfile.NamedTemporaryFile("w", delete=False) as fd: if content: fd.write(content) self.filename = fd.name def read(self): with open(self.filename, "...
from unittest import mock import pytest from src.taipy.core import taipy from src.taipy.core._entity._labeled import _Labeled from taipy.config import Config, Frequency, Scope class MockOwner: label = "owner_label" def get_label(self): return self.label def test_get_label(): ...
# # 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 src.taipy.core._entity._entity_ids import _EntityIds class TestEntityIds: def test_add_two_entity_ids(self): entity_ids_1 = _EntityIds() entity_ids_2 = _EntityIds() entity_ids_1_address = id(entity_ids_1) entity_ids_1.data_node_ids.update(["data_node_id_1", "data_n...
import pytest from src.taipy.core.common._utils import _retry_read_entity from taipy.config import Config def test_retry_decorator(mocker): func = mocker.Mock(side_effect=Exception()) @_retry_read_entity((Exception,)) def decorated_func(): func() with pytest.raises(Exception): ...
from src.taipy.core.common.warn_if_inputs_not_ready import _warn_if_inputs_not_ready from src.taipy.core.data._data_manager_factory import _DataManagerFactory from taipy.config import Config def test_warn_inputs_all_not_ready(caplog): one = Config.configure_data_node("one") two = Config.configure_data_...
# # 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 os import pytest from src.taipy.core.exceptions import ModelNotFound from src.taipy.core.scenario._scenario_fs_repository import _ScenarioFSRepository from src.taipy.core.scenario._scenario_sql_repository import _ScenarioSQLRepository from src.taipy.core.scenario.scenario import Scenario, ScenarioId ...
from src.taipy.core._version._version import _Version from taipy.config.config import Config def test_create_version(): v = _Version("foo", config=Config.configure_data_node("dn")) assert v.id == "foo" assert v.config is not None
import os import pytest from src.taipy.core._version._version import _Version from src.taipy.core._version._version_fs_repository import _VersionFSRepository from src.taipy.core._version._version_sql_repository import _VersionSQLRepository from src.taipy.core.exceptions import ModelNotFound class TestVers...
# # 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 pytest from src.taipy.core._version._version import _Version from src.taipy.core._version._version_manager import _VersionManager from taipy.config.config import Config def test_save_and_get_version_entity(tmpdir): _VersionManager._repository.base_path = tmpdir assert len(_VersionManager._get...
# # 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 unittest import mock import pytest from src.taipy.core._orchestrator._dispatcher import _DevelopmentJobDispatcher, _JobDispatcher, _StandaloneJobDispatcher from src.taipy.core._orchestrator._orchestrator import _Orchestrator from src.taipy.core._orchestrator._orchestrator_factory import _OrchestratorFactor...
import multiprocessing from concurrent.futures import ProcessPoolExecutor from functools import partial from unittest import mock from unittest.mock import MagicMock from pytest import raises from src.taipy.core import DataNodeId, JobId, TaskId from src.taipy.core._orchestrator._dispatcher._development_job_d...
# # 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...
from src.taipy.core.data import InMemoryDataNode from src.taipy.core.data._data_manager_factory import _DataManagerFactory from src.taipy.core.task._task_model import _TaskModel from taipy.config.common.scope import Scope def test_none_properties_attribute_compatible(): model = _TaskModel.from_dict( ...
# # 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 src.taipy.core.sequence._sequence_converter import _SequenceConverter from src.taipy.core.sequence.sequence import Sequence from src.taipy.core.task.task import Task def test_entity_to_model(sequence): sequence_model_1 = _SequenceConverter._entity_to_model(sequence) expected_sequence_model_1 = { ...
# # 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...
from src.taipy.core.data.data_node import DataNode from src.taipy.core.data.in_memory import InMemoryDataNode from taipy.config.common.scope import Scope class FakeDataNode(InMemoryDataNode): read_has_been_called = 0 write_has_been_called = 0 def __init__(self, config_id, **kwargs): sco...
import os import pytest from src.taipy.core.data._data_fs_repository import _DataFSRepository from src.taipy.core.data._data_sql_repository import _DataSQLRepository from src.taipy.core.data.data_node import DataNode, DataNodeId from src.taipy.core.exceptions import ModelNotFound class TestDataNodeReposit...
import pytest from src.taipy.core.data.data_node_id import DataNodeId from src.taipy.core.data.in_memory import InMemoryDataNode from src.taipy.core.exceptions.exceptions import NoData from taipy.config.common.scope import Scope from taipy.config.exceptions.exceptions import InvalidConfigurationId class Tes...
# # 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 datetime import datetime from time import sleep from src.taipy.core._version._version_manager_factory import _VersionManagerFactory from src.taipy.core.submission._submission_manager_factory import _SubmissionManagerFactory from src.taipy.core.submission.submission import Submission from src.taipy.core.subm...
from datetime import datetime from time import sleep from src.taipy.core import Task from src.taipy.core._repository.db._sql_connection import _SQLConnection from src.taipy.core._version._version_manager_factory import _VersionManagerFactory from src.taipy.core.submission._submission_manager_factory import _Subm...
# # 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 os import pathlib from unittest import TestCase, mock from src.taipy.logger._taipy_logger import _TaipyLogger class TestTaipyLogger(TestCase): def test_taipy_logger(self): _TaipyLogger._get_logger().info("baz") _TaipyLogger._get_logger().debug("qux") def test_taipy_logger_...
import os import pytest from src.taipy.config.config import Config from src.taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked from tests.config.utils.named_temporary_file import NamedTemporaryFile config_from_filename = NamedTemporaryFile( """ [TAIPY] custom_property_not_overwritten...
import pytest from src.taipy.config._config import _Config from src.taipy.config._config_comparator._config_comparator import _ConfigComparator from src.taipy.config._serializer._toml_serializer import _TomlSerializer from src.taipy.config.checker.issue_collector import IssueCollector from src.taipy.config.confi...
import os from unittest import mock import pytest from src.taipy.config.exceptions.exceptions import InvalidConfigurationId from tests.config.utils.section_for_tests import SectionForTest from tests.config.utils.unique_section_for_tests import UniqueSectionForTest class WrongUniqueSection(UniqueSectionFor...
# # 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 src.taipy.config.config import Config from src.taipy.config.global_app.global_app_config import GlobalAppConfig from src.taipy.config.section import Section from tests.config.utils.section_for_tests import SectionForTest from tests.config.utils.unique_section_for_tests import UniqueSectionForTest def _tes...
import pytest from src.taipy.config.config import Config from src.taipy.config.exceptions.exceptions import LoadingError from tests.config.utils.named_temporary_file import NamedTemporaryFile def test_node_can_not_appear_twice(): config = NamedTemporaryFile( """ [unique_section_name] attribute...
# # 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 src.taipy.config._config import _Config from src.taipy.config.checker._checker import _Checker class TestDefaultConfigChecker: def test_check_default_config(self): config = _Config._default_config() collector = _Checker._check(config) assert len(collector._errors) == 0 ...
from src.taipy.config.checker.issue import Issue from src.taipy.config.checker.issue_collector import IssueCollector class TestIssueCollector: def test_add_error(self): collector = IssueCollector() assert len(collector.errors) == 0 assert len(collector.warnings) == 0 asser...
# # 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 os from unittest import mock from unittest.mock import MagicMock from src.taipy.config import Config from src.taipy.config.checker._checker import _Checker from src.taipy.config.checker.issue_collector import IssueCollector from tests.config.utils.checker_for_tests import CheckerForTest def test_reg...
import logging from unittest import mock from src.taipy.config._config import _Config from src.taipy.config.checker._checkers._config_checker import _ConfigChecker from src.taipy.config.checker.issue import Issue from src.taipy.config.checker.issue_collector import IssueCollector class MyCustomChecker(_Conf...
from src.taipy.config import IssueCollector from src.taipy.config.checker._checkers._config_checker import _ConfigChecker class CheckerForTest(_ConfigChecker): def _check(self) -> IssueCollector: return self._collector
from copy import copy from typing import Any, Dict, List, Optional from src.taipy.config import Config, Section from src.taipy.config._config import _Config from src.taipy.config.common._config_blocker import _ConfigBlocker from .section_for_tests import SectionForTest class SectionOfSectionsListForTest(S...
# # 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 os import tempfile class NamedTemporaryFile: def __init__(self, content=None): with tempfile.NamedTemporaryFile("w", delete=False) as fd: if content: fd.write(content) self.filename = fd.name def read(self): with open(self.filename, "...
from copy import copy from typing import Any, Dict, Optional from src.taipy.config import Config, Section from src.taipy.config._config import _Config from src.taipy.config.common._config_blocker import _ConfigBlocker class SectionForTest(Section): name = "section_name" _MY_ATTRIBUTE_KEY = "attribu...
from copy import copy from typing import Any, Dict, Optional from src.taipy.config import Config from src.taipy.config._config import _Config from src.taipy.config.common._config_blocker import _ConfigBlocker from src.taipy.config.unique_section import UniqueSection class UniqueSectionForTest(UniqueSection)...
import pytest from src.taipy.config.common._validate_id import _validate_id from src.taipy.config.exceptions.exceptions import InvalidConfigurationId class TestId: def test_validate_id(self): s = _validate_id("foo") assert s == "foo" with pytest.raises(InvalidConfigurationId): ...
import pytest from src.taipy.config.common.scope import Scope def test_scope(): # Test __ge__ method assert Scope.GLOBAL >= Scope.GLOBAL assert Scope.GLOBAL >= Scope.CYCLE assert Scope.CYCLE >= Scope.CYCLE assert Scope.GLOBAL >= Scope.SCENARIO assert Scope.CYCLE >= Scope.SCENARIO ...
# # 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 argparse import re import sys import pytest from src.taipy._cli._base_cli import _CLI if sys.version_info >= (3, 10): argparse_options_str = "options:" else: argparse_options_str = "optional arguments:" def preprocess_stdout(stdout): stdout = stdout.replace("\n", " ").replace("\t"...
import pytest from src.taipy.config.common._classproperty import _Classproperty class TestClassProperty: def test_class_property(self): class TestClass: @_Classproperty def test_property(cls): return "test_property" assert TestClass.test_proper...
import os from unittest import mock import pytest from src.taipy.config.config import Config from src.taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked def test_global_config_with_env_variable_value(): with mock.patch.dict(os.environ, {"FOO": "bar", "BAZ": "qux"}): Config.c...
# # 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 argparse import re from unittest.mock import patch import pytest from src.taipy._entrypoint import _entrypoint from taipy._cli._base_cli import _CLI def preprocess_stdout(stdout): stdout = stdout.replace("\n", " ").replace("\t", " ") return re.sub(" +", " ", stdout) def remove_subpar...
import os import sys from importlib.util import find_spec from pathlib import Path import pandas as pd # type: ignore import pytest from flask import Flask, g def pytest_configure(config): if (find_spec("src") and find_spec("src.taipy")) and (not find_spec("taipy") or not find_spec("taipy.gui")): ...
# # 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, Html def test_simple_html(gui: Gui, helpers): # html_string = "<html><head></head><body><h1>test</h1><taipy:field value=\"test\"/></body></html>" html_string = "<html><head></head><body><h1>test</h1></body></html>" gui._set_frame(inspect.currentframe()) ...
import pytest from taipy.gui import Gui def test_invalid_control_name(gui: Gui, helpers): md_string = "<|invalid|invalid|>" expected_list = ["INVALID SYNTAX - Control is 'invalid'"] helpers.test_control_md(gui, md_string, expected_list) def test_value_to_negated_property(gui: Gui, helpers): ...
import pytest from taipy.gui.utils._bindings import _Bindings def test_exception_binding_twice(gui, test_client): bind = _Bindings(gui) bind._new_scopes() bind._bind("x", 10) with pytest.raises(ValueError): bind._bind("x", 10) def test_exception_binding_invalid_name(gui): ...
from email import message import pytest from taipy.gui._page import _Page def test_exception_page(gui): page = _Page() page._route = "page1" with pytest.raises(RuntimeError, match="Can't render page page1: no renderer found"): page.render(gui)
# # 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...