Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEAllen committed May 29, 2024
1 parent 7408f8b commit c2b0875
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mantidimaging/gui/windows/recon/test/presenter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,20 @@ def test_auto_find_correlation_failed_due_to_180_deg_shape(self, mock_start_asyn
def test_on_stack_reconstruct_slice_done(self):
test_data = ImageStack(np.ndarray(shape=(200, 250), dtype=np.float32))
test_data.record_operation = mock.Mock()
task_mock = mock.Mock(result=test_data, error=None)
task_mock = mock.Mock(result=test_data, error=None, filter_name="gridrec")
# add algorithm name and args to allowed_recon_kwargs
# self.presenter.allowed_recon_kwargs = {
# 'algorithm': self.view.recon_params().algorithm,
# 'filter_name': self.view.recon_params().filter_name,
# 'num_iter': self.view.recon_params().num_iter
# }

self.presenter._get_slice_index = mock.Mock(return_value=7)
# mock allowed_recon_kwargs when calling _on_stack_reconstruct_slice_done to avoid key error
with mock.patch('mantidimaging.gui.windows.recon.presenter.ReconstructWindowPresenter.allowed_recon_kwargs',
self.presenter.allowed_recon_kwargs):

self.presenter._on_stack_reconstruct_slice_done(task_mock)
self.presenter._on_stack_reconstruct_slice_done(task_mock)

self.view.show_recon_volume.assert_called_once()
np.array_equal(self.view.show_recon_volume.call_args[0][0].data, test_data)
Expand Down

0 comments on commit c2b0875

Please sign in to comment.