[PATCH b4 11/27] tests: cover the unaccepted take in the thank-and-archive chain

Christian Brauner <[email protected]> Fri, 31 Jul 2026 11:21:10 +0200
Newsgroups org.kernel.linux.tools
Message-ID <20260731-work-b4-editor-branch-guard-v1-11-de68a7c8e4cb@kernel.org>
The aborted take already has a case. Add the other path that returns
None, accept unchecked in the dialog, so the two stay apart, and give
the harness a knob for it.

Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 src/tests/test_tui_tracking.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/tests/test_tui_tracking.py b/src/tests/test_tui_tracking.py
index e6a25a4..fe68daa 100644
--- a/src/tests/test_tui_tracking.py
+++ b/src/tests/test_tui_tracking.py
@@ -4421,7 +4421,10 @@ class TestTakeThankArchiveChain:
     flow only when the take leaves the series fully accepted."""
 
     def _run_take_final(
-        self, take_status: Optional[str], thank_and_archive: bool
+        self,
+        take_status: Optional[str],
+        thank_and_archive: bool,
+        accept_series: bool = True,
     ) -> Tuple[List[Tuple[Dict[str, Any], bool]], List[str]]:
         """Drive _on_take_final with a mocked take returning *take_status*.
 
@@ -4434,9 +4437,9 @@ class TestTakeThankArchiveChain:
         notices: List[str] = []
         app = TrackingApp.__new__(TrackingApp)
         take_screen: Any = SimpleNamespace(
-            accept_series=True, thank_and_archive=thank_and_archive
+            accept_series=accept_series, thank_and_archive=thank_and_archive
         )
-        confirm_screen: Any = SimpleNamespace(accept_series=True)
+        confirm_screen: Any = SimpleNamespace(accept_series=accept_series)
         series = {'change_id': 'chain-1', 'subject': 'x', 'status': 'reviewing'}
         with (
             patch.object(TrackingApp, 'suspend', lambda self: contextlib.nullcontext()),
@@ -4491,6 +4494,11 @@ class TestTakeThankArchiveChain:
         assert not thanks
         assert any('take did not complete' in n for n in notices)
 
+    def test_unaccepted_take_does_not_chain(self) -> None:
+        thanks, notices = self._run_take_final(None, True, accept_series=False)
+        assert not thanks
+        assert any('not marked accepted' in n for n in notices)
+
     def test_unchecked_box_never_chains(self) -> None:
         thanks, notices = self._run_take_final('accepted', False)
         assert not thanks

-- 
2.53.0