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