From 1e8b135b6a2fef71f1e7e20387bb74d0a620a9e0 Mon Sep 17 00:00:00 2001 From: David Perl Date: Tue, 21 Apr 2026 11:41:06 +0200 Subject: [PATCH] check slot is called --- tests/unit_tests/test_scan_control.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit_tests/test_scan_control.py b/tests/unit_tests/test_scan_control.py index 5709bb5b..41108d5c 100644 --- a/tests/unit_tests/test_scan_control.py +++ b/tests/unit_tests/test_scan_control.py @@ -612,9 +612,18 @@ def test_restore_parameters_with_fewer_arg_bundles(scan_control: ScanControl, qt scan_control.arg_box.add_widget_bundle() assert scan_control.arg_box.count_arg_rows() == 3 + slot_hit = False + + def mock_request(*args): + ScanControl.request_last_executed_scan_parameters(scan_control, *args) + nonlocal slot_hit + slot_hit = True + + scan_control.request_last_executed_scan_parameters = mock_request # Trigger restore of parameters from history scan_control.toggle.checked = True + qtbot.waitUntil(lambda: slot_hit, timeout=1000) # After restore, arg_box should have only one bundle (the history size) qtbot.waitUntil(lambda: scan_control.arg_box.count_arg_rows() == 1, timeout=1000)