Skip to content

Commit d6b19cc

Browse files
committed
test(test_delete_sources): parameterized functional test for deletion of one or more sources
This is a complete rewrite of this test, which now (a) distinguishes between single- and multi-select behavior and (b) checks that the individual sources selected for deletion are confirmed and deleted, not only the *number* of sources selected. This includes a workaround for #2273. Here we also change securedrop_client.gui.widgets.BatchActionToolbar.on_action_triggered() to call QDialog.open(), which is modal with QDialog.setModal(), rather than QDialog.exec(), which is modal *and* blocking, which blocks pytest timers as well as the main event loop.
1 parent c267ce7 commit d6b19cc

File tree

3 files changed

+10702
-24
lines changed

3 files changed

+10702
-24
lines changed

client/securedrop_client/gui/widgets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,9 @@ def on_action_triggered(self) -> None:
555555
targets = self.controller.get_selected_sources()
556556
if targets is not None:
557557
dialog = DeleteSourceDialog(targets)
558+
self._last_dialog = dialog # FIXME: workaround for #2273
558559
dialog.accepted.connect(lambda: self.controller.delete_sources(targets))
559-
dialog.exec()
560+
dialog.open()
560561
else:
561562
# No selected sources should return an empty set, not None
562563
logger.error("Toolbar action triggered without valid data from controller.")

0 commit comments

Comments
 (0)