Skip to content

Commit

Permalink
Unit test TimeSlice vlidation
Browse files Browse the repository at this point in the history
Refs #11490
  • Loading branch information
DanNixon committed Apr 7, 2015
1 parent fe4da94 commit ff98576
Showing 1 changed file with 62 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@ def test_basic(self):
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.
Expand All @@ -32,5 +33,66 @@ def test_suffix(self):

self.assertTrue(mtd.doesExist('irs26173_graphite002_slice'))


def test_validation_peak_range_order(self):
"""
Tests validation of the PeakRange property.
"""

self.assertRaises(RuntimeError,
TimeSlice,
InputFiles=['IRS26173.raw'],
SpectraRange=[3, 53],
PeakRange=[65000, 62500],
BackgroundRange=[59000, 61500],
OutputNameSuffix='_graphite002_slice',
OutputWorkspace='SliceTestOut')


def test_validation_peak_range_count(self):
"""
Tests validation of the PeakRange property.
"""

self.assertRaises(RuntimeError,
TimeSlice,
InputFiles=['IRS26173.raw'],
SpectraRange=[3, 53],
PeakRange=[65000],
BackgroundRange=[59000, 61500],
OutputNameSuffix='_graphite002_slice',
OutputWorkspace='SliceTestOut')


def test_validation_background_range_order(self):
"""
Tests validation of the BackgroundRange property.
"""

self.assertRaises(RuntimeError,
TimeSlice,
InputFiles=['IRS26173.raw'],
SpectraRange=[3, 53],
PeakRange=[65000, 62500],
BackgroundRange=[61500, 59000],
OutputNameSuffix='_graphite002_slice',
OutputWorkspace='SliceTestOut')


def test_validation_peak_range_count(self):
"""
Tests validation of the BackgroundRange property.
"""

self.assertRaises(RuntimeError,
TimeSlice,
InputFiles=['IRS26173.raw'],
SpectraRange=[3, 53],
PeakRange=[65000, 62500],
BackgroundRange=[59000],
OutputNameSuffix='_graphite002_slice',
OutputWorkspace='SliceTestOut')


if __name__ == '__main__':
unittest.main()

0 comments on commit ff98576

Please sign in to comment.