Exemple #1
0
 def test_isfloat_with_scientific_notation_returns_true(self):
     self.assertTrue(utils.is_str_float("1.0e-7"))
Exemple #2
0
 def test_isfloat_with_str_returns_false(self):
     self.assertFalse(utils.is_str_float("foo"))
Exemple #3
0
 def test_isfloat_with_leading_zero_returns_true(self):
     self.assertTrue(utils.is_str_float("01"))
Exemple #4
0
 def test_isfloat_with_negative_float_returns_true(self):
     self.assertTrue(utils.is_str_float("-1.0"))
Exemple #5
0
 def _cast_numeric_values(self, row):
     for k, v in row.items():
         if utils.is_str_int(v):
             row[k] = int(v)
         elif utils.is_str_float(v):
             row[k] = float(v)