|
23 | 23 | class MainWindowViewTest(unittest.TestCase):
|
24 | 24 | def setUp(self) -> None:
|
25 | 25 | with mock.patch("mantidimaging.gui.windows.main.view.WelcomeScreenPresenter"):
|
26 |
| - with mock.patch("mantidimaging.gui.windows.main.view.has_other_shared_arrays", return_value=False): |
27 |
| - with mock.patch("mantidimaging.gui.windows.main.view.QMessageBox", return_value=False): |
28 |
| - self.view = MainWindowView() |
| 26 | + self.view = MainWindowView() |
29 | 27 | self.presenter = mock.MagicMock()
|
30 | 28 | self.view.presenter = self.presenter
|
31 | 29 |
|
@@ -308,34 +306,3 @@ def test_get_images_from_stack_uuid(self):
|
308 | 306 |
|
309 | 307 | self.presenter.get_stack_visualiser.assert_called_once_with(uuid)
|
310 | 308 | self.assertEqual(images, return_value)
|
311 |
| - |
312 |
| - @mock.patch("mantidimaging.gui.windows.main.view.has_other_shared_arrays") |
313 |
| - @mock.patch("mantidimaging.gui.windows.main.view.free_all") |
314 |
| - @mock.patch("mantidimaging.gui.windows.main.view.QMessageBox") |
315 |
| - def test_ask_user_to_free_data(self, QMessageBox: Mock, free_all: Mock, has_other_shared_arrays: Mock): |
316 |
| - has_other_shared_arrays.return_value = True |
317 |
| - # makes the clickedButton the same return value mock as the addButton return |
318 |
| - QMessageBox.return_value.clickedButton.return_value = QMessageBox.return_value.addButton.return_value |
319 |
| - |
320 |
| - self.view.ask_user_to_free_data() |
321 |
| - |
322 |
| - QMessageBox.return_value.setWindowTitle.assert_called_once() |
323 |
| - QMessageBox.return_value.setText.assert_called_once() |
324 |
| - self.assertEquals(QMessageBox.return_value.addButton.call_count, 2) |
325 |
| - QMessageBox.return_value.exec.assert_called_once() |
326 |
| - free_all.assert_called_once() |
327 |
| - |
328 |
| - @mock.patch("mantidimaging.gui.windows.main.view.has_other_shared_arrays") |
329 |
| - @mock.patch("mantidimaging.gui.windows.main.view.free_all") |
330 |
| - @mock.patch("mantidimaging.gui.windows.main.view.QMessageBox") |
331 |
| - def test_ask_user_to_free_data_ignore_pressed(self, QMessageBox: Mock, free_all: Mock, |
332 |
| - has_other_shared_arrays: Mock): |
333 |
| - has_other_shared_arrays.return_value = True |
334 |
| - |
335 |
| - self.view.ask_user_to_free_data() |
336 |
| - |
337 |
| - QMessageBox.return_value.setWindowTitle.assert_called_once() |
338 |
| - QMessageBox.return_value.setText.assert_called_once() |
339 |
| - self.assertEquals(QMessageBox.return_value.addButton.call_count, 2) |
340 |
| - QMessageBox.return_value.exec.assert_called_once() |
341 |
| - free_all.assert_not_called() |
0 commit comments