From fad516961cf2be450199ed39f104cd05aed7791c Mon Sep 17 00:00:00 2001 From: qmadev <190383216+qmadev@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:34:40 +0100 Subject: [PATCH 1/4] Add variable to loop over tuple --- acquire/acquire.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acquire/acquire.py b/acquire/acquire.py index 910e28f4..1f58e1be 100644 --- a/acquire/acquire.py +++ b/acquire/acquire.py @@ -2547,7 +2547,7 @@ def acquire_children_and_targets(target: Target, args: argparse.Namespace) -> li raise if args.children: - for child in target.list_children(): + for _, child in target.list_children(): counter += 1 acquire_gui.shard = int((progress_limit / total_targets) * counter) try: From 806b8d38dfb9fa9a5b00c9e2cf9df6e7a2888566 Mon Sep 17 00:00:00 2001 From: qmadev <190383216+qmadev@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:54:07 +0100 Subject: [PATCH 2/4] Fix unit tests --- tests/test_gui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_gui.py b/tests/test_gui.py index fee38604..382cd03a 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -9,6 +9,8 @@ from acquire.acquire import acquire_children_and_targets from acquire.gui import GUI +from dissect.target.helpers.record import ChildTargetRecord + if TYPE_CHECKING: from collections.abc import Iterator @@ -34,8 +36,8 @@ def test_gui( mock_target: Target, gui: GUI, num_children: int, skip_parent: bool, auto_upload: bool, expected_shards: list[int] ) -> None: - def list_children() -> Iterator[Target]: - yield from [mock_target] * num_children + def list_children() -> Iterator[tuple[str, ChildTargetRecord]]: + yield from [(0, mock_target)] * num_children mock_target.list_children = list_children From 3e6a1f222f2035569d6d3f77ea9e0f17e68becb8 Mon Sep 17 00:00:00 2001 From: qmadev <190383216+qmadev@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:59:52 +0100 Subject: [PATCH 3/4] Add comment --- tests/test_gui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_gui.py b/tests/test_gui.py index 382cd03a..a110544b 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -37,7 +37,8 @@ def test_gui( mock_target: Target, gui: GUI, num_children: int, skip_parent: bool, auto_upload: bool, expected_shards: list[int] ) -> None: def list_children() -> Iterator[tuple[str, ChildTargetRecord]]: - yield from [(0, mock_target)] * num_children + # We do not use the index so just set it to zero. + yield from [("0", mock_target)] * num_children mock_target.list_children = list_children From 37806a1cfede01dd305be6e12acfb8977b60f607 Mon Sep 17 00:00:00 2001 From: qmadev <190383216+qmadev@users.noreply.github.com> Date: Fri, 16 Jan 2026 17:58:43 +0100 Subject: [PATCH 4/4] Fix linter --- tests/test_gui.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_gui.py b/tests/test_gui.py index a110544b..441b57cd 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -9,12 +9,11 @@ from acquire.acquire import acquire_children_and_targets from acquire.gui import GUI -from dissect.target.helpers.record import ChildTargetRecord - if TYPE_CHECKING: from collections.abc import Iterator from dissect.target import Target + from dissect.target.helpers.record import ChildTargetRecord @pytest.mark.parametrize(