Пример #1
0
def test_jsonpointer():
    tl = TypedLeafs(nested_data, datamodel)
    for p, v in tl.leafs():
        try:
            assert tl.jsonpointer(p.path).json() == v.json()
        except AttributeError:
            assert tl.jsonpointer(p.path) == v
Пример #2
0
def test_jsonpointer():
    tl = TypedLeafs(nested_data,datamodel)
    for p, v in tl.leafs():
        try:
            assert tl.jsonpointer(p.path).json() == v.json()
        except AttributeError:
            assert tl.jsonpointer(p.path) == v
Пример #3
0
def pub(publisher, parameters, state):
    topublish = TypedLeafs(publisher['outputmap'], parameters.leafmodel)
    for p, v in topublish.leafs():
        value = parameters[v]
        if type(value) == known_types.SimpleFile:
            if not value.path:
                ensure_publicity(value, state)
        p.set(topublish, value)
    return topublish
Пример #4
0
def test_deepnest():
    tl = TypedLeafs(nested_data, datamodel)
    paths = [p.path for p, v in tl.leafs()]
    assert set(paths) == set(
        ['/list_of_things/0', '/list_of_things/1', '/single_thing'])
Пример #5
0
def test_deepnest():
    tl = TypedLeafs(nested_data,datamodel)
    paths = [p.path for p,v in tl.leafs()]
    assert set(paths) == set(['/list_of_things/0','/list_of_things/1','/single_thing'])