Skip to content

Commit

Permalink
Additional sanity unit test. re #5044
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders-Markvardsen committed Apr 3, 2012
1 parent e3724e5 commit 7687e42
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Code/Mantid/Framework/PythonAPI/test/SANSMaskCommandsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_single_spectrum(self):

def test_horizontal_line(self):
"""
Checks the ISIS specfic mask command for spectra numbers
Checks the ISIS specfic horizontal line masking
"""

# flags some whole spectra for masking
Expand All @@ -61,8 +61,18 @@ def test_horizontal_line(self):
self.assertEqual(self.test_ws.readY(2)[0], 0)
self.assertEqual(self.test_ws.readY(3)[0], 0)
self.assertEqual(self.test_ws.readY(127)[0], 0)
self.assertEqual(self.test_ws.readY(1)[0], 2.0)
self.assertEqual(self.test_ws.readY(1)[0], 2.0) # LoadEmptyInstrument set Monitor Y = 2.0

# now try the same as above but after loading a dataset
ws=Load("LOQ48094.raw","testMaskingTimebins")[0]
ISIS.ReductionSingleton().mask.execute(ISIS.ReductionSingleton(), "testMaskingTimebins")

# Spectrum number is one more than workspace index
self.assertEqual(ws.readY(2)[0], 0)
self.assertEqual(ws.readY(3)[0], 0)
self.assertEqual(ws.readY(127)[0], 0)
self.assertEqual(ws.readY(1)[0], 10.0)

def test_masking_timebins(self):
"""
Time bin masking uses the MaskBins algorithm
Expand Down

0 comments on commit 7687e42

Please sign in to comment.