personal workflow improvements
This commit is contained in:
1 parent
96c00fa941
commit
42a5b9778e
3 files changed
+77
-6
No files matched your search
@@ -27,6 +27,29 @@ class GuiConvenienceTests(unittest.TestCase):
|
||||
self.app.destroy()
|
||||
self.temp.cleanup()
|
||||
|
||||
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")
|
||||
self.app.step_by_id[step.id] = step
|
||||
self.app.current_step = step
|
||||
self.app._render_step()
|
||||
self.assertEqual([button.cget("text") for button in self.app.review_buttons],
|
||||
["gestion_classe re", "gestion_classe wsn", "gestion_classe we"])
|
||||
self.assertEqual(self.app.command_box.winfo_manager(), "")
|
||||
self.assertEqual(self.app.run_button.cget("text"), "Marquer réussie")
|
||||
with patch.object(self.app.runner, "start") as start, \
|
||||
patch.object(self.app, "_move_selection_from") as advance:
|
||||
for button, command in zip(self.app.review_buttons, ("re", "wsn", "we")):
|
||||
button.invoke()
|
||||
self.assertEqual(start.call_args.args[0], ["gestion_classe", command])
|
||||
self.app._finish_process(0, False)
|
||||
self.assertNotEqual(self.app.state_store.step(step.id)["status"], "success")
|
||||
advance.assert_not_called()
|
||||
start.reset_mock()
|
||||
self.app.run_button.invoke()
|
||||
start.assert_not_called()
|
||||
self.assertEqual(self.app.state_store.step(step.id)["status"], "success")
|
||||
|
||||
@staticmethod
|
||||
def _label_texts(widget):
|
||||
return [
|
||||
|
||||
Reference in new issue
Block a user