示例#1
0
 def test_parse_special_float(self):
     self.assertEqual(native.yaml_load('.inf'), Decimal('Infinity'))
     self.assertEqual(native.yaml_load('-.inf'), -Decimal('Infinity'))
     self.assertTrue(math.isnan(native.yaml_load('.nan')))
示例#2
0
 def test_parse_special_float(self):
     self.assertEqual(native.yaml_load('.inf'), Decimal('Infinity'))
     self.assertEqual(native.yaml_load('-.inf'), -Decimal('Infinity'))
     self.assertTrue(math.isnan(native.yaml_load('.nan')))
示例#3
0
 def test_parse_normal_float(self):
     v = native.yaml_load('-23.456')
     self.assertEqual(v, Decimal('-23.456'))
     self.assertIsInstance(v, Decimal)
示例#4
0
 def test_parse_normal_float(self):
     v = native.yaml_load('-23.456')
     self.assertEqual(v, Decimal('-23.456'))
     self.assertIsInstance(v, Decimal)