Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeigh committed Nov 27, 2024
1 parent 1f28470 commit d40e09d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,11 @@ def handle_export_csv(self) -> None:

rois = {
roi.name: roi.as_sensible_roi()
for roi in self.view.spectrum_widget.roi_dict.values() if isinstance(roi, SpectrumROI)}
for roi in self.view.spectrum_widget.roi_dict.values() if isinstance(roi, SpectrumROI)
}

self.model.save_csv(path=path,
rois=rois,
self.model.save_csv(path,
rois,
normalise=self.spectrum_mode == SpecType.SAMPLE_NORMED,
normalise_with_shuttercount=self.view.shuttercount_norm_enabled())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ def test_handle_export_csv(self, path_name: str, mock_save_csv: mock.Mock, mock_
self.presenter.handle_export_csv()

self.view.get_csv_filename.assert_called_once()
mock_save_csv.assert_called_once_with(Path("/fake/path.csv"), False, False)
mock_save_csv.assert_called_once_with(Path("/fake/path.csv"), {},
normalise=False,
normalise_with_shuttercount=False)

@parameterized.expand(["/fake/path", "/fake/path.dat"])
@mock.patch("mantidimaging.gui.windows.spectrum_viewer.model.SpectrumViewerWindowModel.save_rits_roi")
Expand Down

0 comments on commit d40e09d

Please sign in to comment.