Skip to content

Commit

Permalink
Fix tests for older Python
Browse files Browse the repository at this point in the history
Refs #11097
  • Loading branch information
DanNixon committed Mar 17, 2015
1 parent 13ec965 commit fbb4522
Showing 1 changed file with 24 additions and 16 deletions.
Expand Up @@ -84,43 +84,51 @@ def test_fail_spec_min(self):
Tests validation for SpecMin >= num histograms.
"""

with self.assertRaises(RuntimeError):
msd, param, fit = MSDFit(InputWorkspace=self._ws,
XStart=0.0, XEnd=5.0,
SpecMin=0, SpecMax=20)
self.assertRaises(RuntimeError,
MSDFit,
InputWorkspace=self._ws,
XStart=0.0, XEnd=5.0,
SpecMin=0, SpecMax=20,
OutputWorkspace='msd')


def test_fail_spec_range(self):
"""
Test svalidation for SpecMax >= SpecMin.
"""

with self.assertRaises(RuntimeError):
msd, param, fit = MSDFit(InputWorkspace=self._ws,
XStart=0.0, XEnd=5.0,
SpecMin=1, SpecMax=0)
self.assertRaises(RuntimeError,
MSDFit,
InputWorkspace=self._ws,
XStart=0.0, XEnd=5.0,
SpecMin=1, SpecMax=0,
OutputWorkspace='msd')


def test_fail_x_range(self):
"""
Tests validation for XStart < XEnd.
"""

with self.assertRaises(RuntimeError):
msd, param, fit = MSDFit(InputWorkspace=self._ws,
XStart=10.0, XEnd=5.0,
SpecMin=0, SpecMax=0)
self.assertRaises(RuntimeError,
MSDFit,
InputWorkspace=self._ws,
XStart=10.0, XEnd=5.0,
SpecMin=0, SpecMax=0,
OutputWorkspace='msd')


def test_fail_x_range_ws(self):
"""
Tests validation for X range in workspace range
"""

with self.assertRaises(RuntimeError):
msd, param, fit = MSDFit(InputWorkspace=self._ws,
XStart=0.0, XEnd=20.0,
SpecMin=0, SpecMax=0)
self.assertRaises(RuntimeError,
MSDFit,
InputWorkspace=self._ws,
XStart=0.0, XEnd=20.0,
SpecMin=0, SpecMax=0,
OutputWorkspace='msd')


if __name__ == '__main__':
Expand Down

0 comments on commit fbb4522

Please sign in to comment.