Example #1
0
def test_double():
  assert leon.loads(leon.dumps(2.2222222)) == 2.2222222
  assert leon.loads(leon.dumps(-2.2222)) == -2.2222
Example #2
0
def test_array():
  obj = [{'a': 2.2, 'b': 500, 'c': 10000}, {'a': 2.5, 'b': 400, 'c': 100}, {'a': 2.6, 'b': 7.7, 'c': 10}]
  assert leon.loads(leon.dumps(obj)) == obj
Example #3
0
def test_object():
  obj = {'a': 1, 'b': 2}
  assert leon.loads(leon.dumps(obj)) == obj
Example #4
0
def test_float():
  assert leon.loads(leon.dumps(0.5)) == 0.5