aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_backends.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests/test_backends.py')
-rw-r--r--app/tests/test_backends.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/tests/test_backends.py b/app/tests/test_backends.py
index 9ecedd1..0d3be37 100644
--- a/app/tests/test_backends.py
+++ b/app/tests/test_backends.py
@@ -304,20 +304,24 @@ class QwenSetupScreenTests(unittest.TestCase):
def test_abort_returns_one_without_executing(self):
from backends import qwen
with patch.object(qwen, "_wizard", return_value=None) as mk_wizard, \
- patch.object(qwen, "_execute") as mk_execute:
+ patch.object(qwen, "_execute_steps") as mk_steps:
rc = qwen.setup_screen(None)
self.assertEqual(rc, 1)
mk_wizard.assert_called_once()
- mk_execute.assert_not_called()
+ mk_steps.assert_not_called()
- def test_success_executes_the_tail_under_suspend(self):
- import contextlib
+ def test_success_runs_the_tail_in_the_task_view(self):
from backends import qwen
settings = {"custom_port": 7860}
+ steps = [qwen.taskview.TaskStep("t", lambda emit, cancel: 0)]
with patch.object(qwen, "_wizard", return_value=settings), \
- patch.object(qwen, "_execute", return_value=0) as mk_execute, \
- patch.object(qwen.tui, "suspend", contextlib.nullcontext):
+ patch.object(qwen, "_execute_steps",
+ return_value=steps) as mk_steps, \
+ patch.object(qwen.taskview, "run_steps",
+ return_value=0) as mk_run:
rc = qwen.setup_screen(None)
self.assertEqual(rc, 0)
- mk_execute.assert_called_once()
- self.assertIs(mk_execute.call_args[0][0], settings)
+ mk_steps.assert_called_once()
+ self.assertIs(mk_steps.call_args[0][0], settings)
+ mk_run.assert_called_once()
+ self.assertEqual(mk_run.call_args[0][2], steps)