Skip to content

Commit

Permalink
recon iters preview test
Browse files Browse the repository at this point in the history
  • Loading branch information
DolicaAkelloEgwel committed Dec 1, 2020
1 parent 65230af commit 3c6caff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mantidimaging/gui/dialogs/cor_inspection/test/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX - License - Identifier: GPL-3.0-or-later

import unittest
from unittest.mock import Mock, patch

import numpy.testing as npt

Expand Down Expand Up @@ -102,3 +103,14 @@ def test_iterations(self):
m.adjust(ImageType.MORE)
self.assertEqual(m.centre_value, 75)
self.assertEqual(m.step, 25)

@patch('mantidimaging.gui.dialogs.cor_inspection.model.replace')
def test_recon_iters_preview(self, replace_mock):
images = generate_images()
m = CORInspectionDialogModel(images, 5, ScalarCoR(20), ReconstructionParameters('FBP_CUDA', 'ram-lak'), True)

m.reconstructor = Mock()
m.recon_preview(ImageType.CURRENT)
replace_mock.assert_called_once_with(m.recon_params, num_iter=100)
m.reconstructor.single_sino.assert_called_once_with(m.sino, m.initial_cor, m.proj_angles,
replace_mock.return_value)

0 comments on commit 3c6caff

Please sign in to comment.