Skip to content

Commit

Permalink
Refs #9529. Making unit test happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Jun 18, 2014
1 parent af3caf4 commit caafe6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Expand Up @@ -135,7 +135,12 @@ def processInformation(self, prop_man, info_dict):
if type("") == type(val):
val = [float(x) for x in val.split(',')]

prop_man[key] = val
try:
prop_man[key] = val
except TypeError:
# Converter error, so remove old value first
del prop_man[key]
prop_man[key] = val

def closeEnough(self, left, right):
left = float(left)
Expand Down
Expand Up @@ -91,8 +91,12 @@ def test_exception(self):

def compareResult(self, expect, manager):
for key in expect.keys():
self.assertEqual(expect[key], manager.getProperty(key).value,
"'%s' doesn't have expected value" % key)
if type([]) == type(expect[key]):
self.assertSequenceEqual(expect[key],
manager.getProperty(key).value)
else:
self.assertEqual(expect[key], manager.getProperty(key).value,
"'%s' doesn't have expected value" % key)


def test_emptyChar(self):
Expand All @@ -118,8 +122,8 @@ def test_fullChar(self):
"vanadium":17702,
"container":17711,
"empty":0,
"d_min":"0.05",
"d_max":"2.20",
"d_min":[0.05],
"d_max":[2.20],
"tof_min":0000.00,
"tof_max":16666.67}
self.compareResult(result,
Expand Down

0 comments on commit caafe6b

Please sign in to comment.