File: test_decode.py

package info (click to toggle)
pyamf 0.6.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,692 kB
  • sloc: python: 17,944; xml: 455; makefile: 116; sql: 38; java: 11; sh: 7
file content (11 lines) | stat: -rw-r--r-- 318 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import simplejson as S
import decimal
def test_decimal():
    rval = S.loads('1.1', parse_float=decimal.Decimal)
    assert isinstance(rval, decimal.Decimal)
    assert rval == decimal.Decimal('1.1')

def test_float():
    rval = S.loads('1', parse_int=float)
    assert isinstance(rval, float)
    assert rval == 1.0