def testToFloatWithDefaultSpecified(self): """Test toFloat with new default""" f = util.toFloat("UNDEFINED", 999.9) self.assertIsInstance(f, float) self.assertEqual(f, 999.9)
def testToFloatWithDefaultReturnNone(self): """Test toFloat with return none""" f = util.toFloat("Foo") self.assertIsNone(f)
def testToFloat(self): """Test toFloat with float string""" f = util.toFloat("4.2") self.assertIsInstance(f, float) self.assertEqual(f, 4.2)