-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack change units tests added to Spectrum Viewer #2235
Conversation
Note: I have said that it progresses the issues in case we want to add some more tests to the PR :) |
self.assertEqual(self.presenter.model.tof_mode, expected_tof_mode) | ||
|
||
@parameterized.expand([ | ||
(None, "Image Index", ToFUnitMode.IMAGE_NUMBER, np.arange(1, 10), [mock.call(False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small tweak that reduces the wrapping. If you change [mock.call(False), mock.call(True)],
to [False, True]
, then you can turn the into call
s in the method
expected_calls = [mock.call(b) for b in expected_calls]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and passes tests.
Issue
Progresses #2213 and #2032
Description
Added unit tests to check the tof mode is changed correctly when:
ToFUnitMode.WAVELENGTH
,ToFUnitMode.ENERGY
,ToFUnitMode.TOF_US
)These tests check that the tof mode is changed as expected but also if the right click units menu has the correct behaviour (i.e. disabling when there is no spectra file and enabling when there is a spectrum file).
A test has also been added to check that when there is no stack available in the spectrum viewer (i.e. it has been deleted in the Main Window), then the tof mode and right click menu behaves appropriately.
Acceptance Criteria
Test that all tests pass with
make check
Documentation
Release note