def test_from_json(self): x = Value.from_json({'__value__': {'value': 25.0, 'units': 'cm'}}) self.assertEqual(x.value, 25.0) self.assertEqual(x.units, 'cm')
def decode_value(self, dct): from blmath.value import Value if "__value__" in dct.keys(): return Value.from_json(dct)