Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added grouped output, usage example and unit test
Refs #10264
- Loading branch information
Showing
4 changed files
with
75 additions
and
2 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
47 changes: 47 additions & 0 deletions
47
Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/TimeSliceTest.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,47 @@ | ||
import unittest | ||
from mantid.simpleapi import * | ||
from mantid.api import * | ||
|
||
class TimeSliceTest(unittest.TestCase): | ||
|
||
def test_basic(self): | ||
""" | ||
Test to ensure that algorithm completes succesfully. | ||
""" | ||
|
||
TimeSlice(InputFiles=['IRS26173.raw'], | ||
SpectraRange=[3, 53], | ||
PeakRange=[62500, 65000], | ||
BackgroundRange=[59000, 61500]) | ||
|
||
self.assertTrue(mtd.doesExist('irs26173_slice')) | ||
|
||
def test_group(self): | ||
""" | ||
Tests to ensure that result workspaces are goruped correctly. | ||
""" | ||
|
||
TimeSlice(InputFiles=['IRS26173.raw'], | ||
SpectraRange=[3, 53], | ||
PeakRange=[62500, 65000], | ||
BackgroundRange=[59000, 61500], | ||
OutputWorkspaceGroup='SliceTestOut') | ||
|
||
self.assertTrue(mtd.doesExist('SliceTestOut')) | ||
self.assertTrue(mtd.doesExist('irs26173_slice')) | ||
|
||
def test_suffix(self): | ||
""" | ||
Tests to ensure that output names have a suffic appended correctly. | ||
""" | ||
|
||
TimeSlice(InputFiles=['IRS26173.raw'], | ||
SpectraRange=[3, 53], | ||
PeakRange=[62500, 65000], | ||
BackgroundRange=[59000, 61500], | ||
OutputNameSuffix='_graphite002_slice') | ||
|
||
self.assertTrue(mtd.doesExist('irs26173_graphite002_slice')) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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