From 3e546ce62b500ecb130ef9e2bf1d1cb0be8122dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fred=20Lef=C3=A9v=C3=A8re-Laoide?= Date: Mon, 25 Nov 2024 10:29:46 +0100 Subject: [PATCH] fix test --- taipy/gui_core/_context.py | 6 +++--- taipy/gui_core/_utils.py | 2 +- tests/gui_core/test_context_is_readable.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/taipy/gui_core/_context.py b/taipy/gui_core/_context.py index da6fcd5729..ad7897e18a 100644 --- a/taipy/gui_core/_context.py +++ b/taipy/gui_core/_context.py @@ -70,7 +70,7 @@ _GuiCoreScenarioProperties, _invoke_action, ) -from ._utils import ClientStatus +from ._utils import _ClientStatus from .filters import CustomScenarioFilter @@ -93,7 +93,7 @@ def __init__(self, gui: Gui) -> None: self.data_nodes_by_owner: t.Optional[t.Dict[t.Optional[str], t.List[DataNode]]] = None self.scenario_configs: t.Optional[t.List[t.Tuple[str, str]]] = None self.jobs_list: t.Optional[t.List[Job]] = None - self.client_submission: t.Dict[str, ClientStatus] = {} + self.client_submission: t.Dict[str, _ClientStatus] = {} # register to taipy core notification reg_id, reg_queue = Notifier.register() # locks @@ -639,7 +639,7 @@ def submit_entity(self, state: State, id: str, payload: t.Dict[str, str]): client_id=self.gui._get_client_id(), module_context=self.gui._get_locals_context(), ) - client_status = ClientStatus(self.gui._get_client_id(), submission_entity.submission_status) + client_status = _ClientStatus(self.gui._get_client_id(), submission_entity.submission_status) with self.submissions_lock: self.client_submission[submission_entity.id] = client_status if Config.core.mode == "development": diff --git a/taipy/gui_core/_utils.py b/taipy/gui_core/_utils.py index 497f20d161..bdb7656b7b 100644 --- a/taipy/gui_core/_utils.py +++ b/taipy/gui_core/_utils.py @@ -15,6 +15,6 @@ @dataclass -class ClientStatus: +class _ClientStatus: client_id: t.Optional[str] submission_status: SubmissionStatus diff --git a/tests/gui_core/test_context_is_readable.py b/tests/gui_core/test_context_is_readable.py index 29242610ec..c2b79359e5 100644 --- a/tests/gui_core/test_context_is_readable.py +++ b/tests/gui_core/test_context_is_readable.py @@ -29,6 +29,7 @@ from taipy.core.task._task_manager_factory import _TaskManagerFactory from taipy.gui import Gui from taipy.gui_core._context import _GuiCoreContext +from taipy.gui_core._utils import _ClientStatus a_cycle = Cycle(Frequency.DAILY, {}, datetime.now(), datetime.now(), datetime.now(), id=CycleId("CYCLE_id")) a_scenario = Scenario("scenario_config_id", None, {}, sequences={"sequence": {}}) @@ -201,7 +202,7 @@ def test_submission_status_callback(self): def sub_cb(): return True - gui_core_context.client_submission[a_submission.id] = SubmissionStatus.UNDEFINED + gui_core_context.client_submission[a_submission.id] = _ClientStatus("", SubmissionStatus.UNDEFINED) gui_core_context.submission_status_callback(a_submission.id) mockget.assert_called() found = False