Make personal evaluation creation and deployment steps executable

This commit is contained in:
sebastien committed 2026-11-03 11:38:14 +01:00
1 parent 8c1fa0af57
commit 5de70dbc0d
4 files changed
+67 -9

No files matched your search

+44
View File
@@ -64,6 +64,50 @@ class GuiConvenienceTests(unittest.TestCase):
self.assertEqual(command[-2:], ['repair-orientation', str(self.evaluation)])
self.assertEqual(self.app.active_step_id, 'labels')
def test_personal_deploy_runs_generated_script_and_tracks_result(self):
from copienator_gui.workflow import build_workflow
step = next(step for step in build_workflow(True) if step.id == "personal_deploy")
self.app.step_by_id[step.id] = step
self.app.current_step = step
self.app._render_step()
self.assertEqual(self.app.run_button.cget("text"), "Exécuter")
with patch.object(self.app.runner, "start") as start, \
patch.object(self.app, "_move_selection_from"):
self.app.run_button.invoke()
self.assertEqual(start.call_args.args[0],
["bash", str(Path.home() / "Scripts" / "deploy-copies-interro.sh")])
self.assertNotEqual(self.app.state_store.step(step.id)["status"], "success")
self.app._finish_process(1, False)
self.assertNotEqual(self.app.state_store.step(step.id)["status"], "success")
self.app.run_button.invoke()
self.app._finish_process(0, False)
self.assertEqual(self.app.state_store.step(step.id)["status"], "success")
def test_personal_create_executes_with_defaults_and_tracks_result(self):
from copienator_gui.workflow import build_workflow
step = next(step for step in build_workflow(True) if step.id == "personal_create")
self.app.step_by_id[step.id] = step
self.app.current_step = step
self.app._render_step()
self.assertEqual(self.app.run_button.cget("text"), "Exécuter")
self.assertEqual(self.app.arg_vars["evaluation_name"].get(), self.evaluation.name)
self.assertEqual(self.app.arg_vars["week"].get(), "")
with patch.object(self.app.runner, "start") as start, \
patch.object(self.app, "_move_selection_from"):
self.app.run_button.invoke()
self.assertEqual(start.call_args.args[0],
["gestion_classe", "ne", "--defaults", self.evaluation.name])
self.assertNotEqual(self.app.state_store.step(step.id)["status"], "success")
self.app._finish_process(1, False)
self.assertNotEqual(self.app.state_store.step(step.id)["status"], "success")
self.app.arg_vars["evaluation_name"].set("DS02VB custom")
self.app.arg_vars["week"].set("3")
self.app.run_button.invoke()
self.assertEqual(start.call_args.args[0],
["gestion_classe", "ne", "--defaults", "DS02VB custom", "--week", "3"])
self.app._finish_process(0, False)
self.assertEqual(self.app.state_store.step(step.id)["status"], "success")
def test_personal_review_commands_require_explicit_completion(self):
from copienator_gui.workflow import build_workflow
step = next(step for step in build_workflow(True) if step.id == "personal_read")