From 381ec6de69e2c369fd898338c73d2d04b54fa266 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 26 Oct 2026 21:09:53 +0100 Subject: [PATCH] fix: say why the plan's numbers differ --- install.py | 10 ++++++++-- tests/test_install_tui.py | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/install.py b/install.py index 268b691a0..d5732b4f7 100644 --- a/install.py +++ b/install.py @@ -12044,8 +12044,14 @@ def _plan_lines(check: dict, dest: Path | None, state: TuiState) -> list: ] if state.facts.get("writable") is False: lines.append("You cannot write to this folder: choose another one.") - lines.append(f"{check['present']} in place, {check['missing']} missing, " - f"{wrong} wrong {'copy' if wrong == 1 else 'copies'}") + counts = (f"{check['present']} in place, {check['missing']} missing, " + f"{wrong} wrong {'copy' if wrong == 1 else 'copies'}") + if copied and fetch: + # 47 to download above 49 missing and 1 wrong copy: the 3 found on + # this machine are the difference, said where the sum is read. + counts += (f": {len(copied)} of them {'is' if len(copied) == 1 else 'are'} " + f"copied from this machine, {fetch} downloaded") + lines.append(counts) saves = (state.saves if check is state.check else state.dry_saves if check is state.dry else None) lines += [_styled(line, "path") for line in _saves_lines(state, saves)] diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index b3c586710..e3d8b2e65 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -3908,6 +3908,19 @@ class TheFolderScreenSaysWhatItOffers(unittest.TestCase): self.assertEqual(rows[state.focus["folder"]].action, "browse") +class ThePlanNumbersAddUp(unittest.TestCase): + """"47 files to download" sat above "49 missing, 1 wrong copy": the 3 + found on this machine were the difference, left to the reader.""" + + def test_the_copied_files_are_the_difference(self): + state = checked_state() + state.found = [found("scph5500.bin", str(SYSTEM_DIR), "one folder too deep")] + screen = " ".join(" ".join(install.tui_view(state, 120, 40)).split()) + self.assertIn("3 files to download", screen) + self.assertIn("1 in place, 3 missing, 1 wrong copy: 1 of them is copied from this " + "machine, 3 downloaded", screen) + + class NothingFoundIsSaid(unittest.TestCase): """With nothing detected the first screen was the list of 18 setups, with no line at 40x15 saying nothing was found, which the beginner's