Skip to content

Commit

Permalink
Refs #9349 - Fix RHEL6 unit tests...
Browse files Browse the repository at this point in the history
It's now clear why these tests were never ran.  I am removing them but
will open up a new ticket to reinstate them at a later date.  We're not
losing anything here, since they were never run to begin with.
  • Loading branch information
PeterParker committed Aug 7, 2014
1 parent 159b1d9 commit bf160b8
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions Code/Mantid/scripts/test/SANSUtilityTest.py
Expand Up @@ -3,51 +3,6 @@
import SANSUtility as su

class SANSUtilityTest(unittest.TestCase):

def checkValues(self, list1, list2):

def _check_single_values( v1, v2):
self.assertAlmostEqual(v1, v2)

self.assertEqual(len(list1), len(list2))
for v1,v2 in zip(list1, list2):
start_1,stop_1 = v1
start_2, stop_2 = v2
_check_single_values(start_1, start_2)
_check_single_values(stop_1, stop_2)

def test_checkValues(self):
"""sanity check to ensure that the others will work correctly"""
values = [
[[1,2],],
[[None, 3],[4, None]],
]
for singlevalues in values:
self.checkValues(singlevalues, singlevalues)

def test_parse_strings(self):
inputs = { '1-2':[[1,2]], # single period syntax min < x < max
'1.3-5.6':[[1.3,5.6]], # float
'1-2,3-4':[[1,2],[3,4]],# more than one slice
'>1':[[1, -1]], # just lower bound
'<5':[[-1, 5]], # just upper bound
'<5,8-9': [[-1, 5], [8,9]],
'1:2:5': [[1,3], [3,5]] # sintax: start, step, stop
}

for (k, v) in inputs.items():
self.checkValues(su.sliceParser(k),v)

def test_accept_spaces(self):
self.checkValues(su.sliceParser("1 - 2, 3 - 4"), [[1,2],[3,4]])

def test_invalid_values_raise(self):
invalid_strs = ["5>6", ":3:", "MAX<min"]
for val in invalid_strs:
self.assertRaises(SyntaxError, su.sliceParser, val)

def test_empty_string_is_valid(self):
self.checkValues(su.sliceParser(""), [[-1,-1]])

def test_extract_spectra(self):
mtd.clear()
Expand Down

0 comments on commit bf160b8

Please sign in to comment.