symbian-qemu-0.9.1-12/python-2.6.1/Lib/json/tests/test_decode.py
author MattD <mattd@symbian.org>
Wed, 10 Mar 2010 16:08:53 +0000
changeset 48 34cd6bf038ac
parent 1 2fb8b9db1c86
permissions -rw-r--r--
Very rough additions to get baseport building after the header reorganisation. Original hardcoded systeminclude paths still left in.

import decimal
from unittest import TestCase

import json

class TestDecode(TestCase):
    def test_decimal(self):
        rval = json.loads('1.1', parse_float=decimal.Decimal)
        self.assert_(isinstance(rval, decimal.Decimal))
        self.assertEquals(rval, decimal.Decimal('1.1'))

    def test_float(self):
        rval = json.loads('1', parse_int=float)
        self.assert_(isinstance(rval, float))
        self.assertEquals(rval, 1.0)