Skip to content

Commit

Permalink
fix test
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 25, 2024
1 parent 69c5466 commit 3e546ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions taipy/gui_core/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
_GuiCoreScenarioProperties,
_invoke_action,
)
from ._utils import ClientStatus
from ._utils import _ClientStatus
from .filters import CustomScenarioFilter


Expand All @@ -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
Expand Down Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion taipy/gui_core/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@


@dataclass
class ClientStatus:
class _ClientStatus:
client_id: t.Optional[str]
submission_status: SubmissionStatus
3 changes: 2 additions & 1 deletion tests/gui_core/test_context_is_readable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}})
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3e546ce

Please sign in to comment.