Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix/10057_indirecttrans_python_algorithm' into develop
Conflicts: Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui Refs #10057
- Loading branch information
Showing
11 changed files
with
200 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...amework/PythonInterface/test/python/plugins/algorithms/IndirectTransmissionMonitorTest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import unittest, os | ||
import mantid | ||
from mantid.simpleapi import * | ||
|
||
class IndirectTransmissionMonitorTest(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
##TODO: Create sample workspaces | ||
sample_workspace = Load('IRS26176.RAW') | ||
can_workspace = Load('IRS26173.RAW') | ||
|
||
cls._sample_workspace = sample_workspace | ||
cls._can_workspace = can_workspace | ||
|
||
def setUp(self): | ||
self.kwargs = {} | ||
self.kwargs['SampleWorkspace'] = self._sample_workspace | ||
self.kwargs['CanWorkspace'] = self._can_workspace | ||
self.kwargs['Verbose'] = True | ||
self.kwargs['Plot'] = False | ||
|
||
def tearDown(self): | ||
# Clean up saved nexus files | ||
path = os.path.join(config['defaultsave.directory'], 'IndirectTransmissionMonitorTest.nxs') | ||
if os.path.isfile(path): | ||
try: | ||
os.remove(path) | ||
except IOError, _: | ||
pass | ||
|
||
def test_basic(self): | ||
trans_workspace = IndirectTransmissionMonitor(**self.kwargs) | ||
|
||
self.assertTrue(isinstance(trans_workspace, mantid.api.WorkspaceGroup), msg='Result should be a workspace group') | ||
self.assertEqual(trans_workspace.size(), 3, msg='Transmission workspace group should have 3 workspaces: sample, can and transfer') | ||
|
||
def test_nexus_save(self): | ||
self.kwargs['Save'] = True | ||
self.kwargs['OutputWorkspace'] = 'IndirectTransmissionMonitorTest' | ||
|
||
IndirectTransmissionMonitor(**self.kwargs) | ||
|
||
path = os.path.join(config['defaultsave.directory'], 'IndirectTransmissionMonitorTest.nxs') | ||
self.assertTrue(os.path.isfile(path), msg='Transmission workspace should be saved to default save directory') | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
52 changes: 0 additions & 52 deletions
52
...ework/PythonInterface/test/python/plugins/algorithms/IndirectTransmissionReductionTest.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.