MCPcopy Create free account
hub / github.com/simplejson/simplejson / test_float

Method test_float

simplejson/tests/test_subclass.py:29–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 self.assertEqual(json.loads(json.dumps({AlternateInt(1): 1})), {'1': 1})
28
29 def test_float(self):
30 self.assertEqual(json.dumps(AlternateFloat(1.0)), '1.0')
31 self.assertEqual(json.dumps(AlternateFloat(-1.0)), '-1.0')
32 self.assertEqual(json.loads(json.dumps({AlternateFloat(1.0): 1})), {'1.0': 1})
33
34 # NOTE: Decimal subclasses are not supported as-is
35 # def test_decimal(self):

Callers

nothing calls this directly

Calls 3

AlternateFloatClass · 0.85
dumpsMethod · 0.80
loadsMethod · 0.80

Tested by

no test coverage detected