Example #1
0
def tree_cache_get(tree):
    with _get_mc() as mc:
        if not mc:
            return None
        data = mc.get(tree.encode('utf-8'))
        if not data:
            return
        return api.loads(types.JsonTree, data.decode('utf-8'))
def test_loads():
    thing = api.loads(TestType, '{"name": "n", "value": 3}')
    eq_((thing.name, thing.value), (u'n', 3))
def test_loads():
    thing = api.loads(TestType, '{"name": "n", "value": 3}')
    eq_((thing.name, thing.value), (u'n', 3))