Skip to content

Commit d7ceae6

Browse files
test_replace_image_stack: wait for new stack to be loaded
1 parent b67b260 commit d7ceae6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mantidimaging/gui/test/gui_system_loading_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ def test_replace_image_stack(self, mocked_select_file):
236236
self._load_data_set()
237237
self.assertEqual(len(self.main_window.presenter.get_active_stack_visualisers()), 5)
238238
self.assertEqual(100, list(self.main_window.presenter.datasets)[0].sample.data.shape[0])
239+
initial_sample_id = list(self.main_window.presenter.datasets)[0].sample.id
239240

240241
self.main_window.dataset_tree_widget.topLevelItem(0).setSelected(True)
241242
self._check_datasets_consistent()
@@ -248,8 +249,9 @@ def test_replace_image_stack(self, mocked_select_file):
248249
gofn.return_value = (str(new_stack), None)
249250
self.main_window.add_to_dataset_dialog.chooseFileButton.click()
250251

251-
self.main_window.add_to_dataset_dialog.accepted.emit()
252-
QTest.qWait(SHORT_DELAY)
252+
self.main_window.add_to_dataset_dialog.accept()
253+
wait_until(lambda: initial_sample_id not in self.main_window.presenter.all_stack_ids)
254+
253255
self._check_datasets_consistent()
254256
self.assertEqual(20, list(self.main_window.presenter.datasets)[0].sample.data.shape[0])
255257

0 commit comments

Comments
 (0)