def test_decode_circular(self): thing = {} thing['me'] = thing encoded = jsog.encode(thing) back = jsog.decode(encoded) self.assertFalse('@id' in back) self.assertTrue(back['me'] is back)
def test_decode_plain_json(self): json = { "foo": "bar" } decoded = jsog.decode(json) self.assertEqual(json, decoded)
def test_decode_null(self): decoded = jsog.decode(None) self.assertEqual(decoded, None)