def test_floatlistToString(self): self.assertRaises(TypeError, util.floatlistFromString, self.ione) self.assertRaises(TypeError, util.floatlistFromString, self.fone) self.assertRaises(TypeError, util.floatlistFromString, self.btrue) self.assertRaises(TypeError, util.floatlistFromString, self.tsimple) self.assertRaises(TypeError, util.floatlistFromString, self.lsimple) self.assertEqual(util.floatlistFromString(""),[]) self.assertEqual(util.floatlistFromString("1.0,2.0,3.0"),[1.0,2.0,3.0]) self.assertEqual(util.floatlistFromString("-1.0,2.0,3.0"),[-1.0,2.0,3.0])
def setBoundariesFromString(self, value): self._boundaries = floatlistFromString(value) self._nlayers = len(self._boundaries) + 1