Przeglądaj źródła

Merge pull request #220 from Avaiga/hotfix2.3/core#635-wrong-import-in-run

Hotfix2.3/Core635 - Wrong _CoreCLI import
Đỗ Trường Giang 1 rok temu
rodzic
commit
2de22def60
2 zmienionych plików z 9 dodań i 1 usunięć
  1. 1 1
      src/taipy/_run.py
  2. 8 0
      tests/test_run.py

+ 1 - 1
src/taipy/_run.py

@@ -42,7 +42,7 @@ def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
     core = __get_app(services, Core)
 
     if gui and core:
-        from taipy.core._version._cli._core_cli import _CoreCLI
+        from taipy.core._core_cli import _CoreCLI
         from taipy.gui._gui_cli import _GuiCLI
 
         _CoreCLI.create_parser()

+ 8 - 0
tests/test_run.py

@@ -53,3 +53,11 @@ def test_run_pass_with_gui_and_rest(core_run, rest_run, gui_run):
     gui_run.assert_called_once()
     core_run.assert_called_once()
     rest_run.assert_not_called()
+
+
+@mock.patch("taipy.gui.Gui.run")
+@mock.patch("taipy.core.Core.run")
+def test_run_pass_with_gui_and_core(core_run, gui_run):
+    _run(Gui(), Core())
+    gui_run.assert_called_once()
+    core_run.assert_called_once()