Exemplo n.º 1
0
def test_has_no_top():
    stack = Metastack()
    assert stack.has('something') == False
Exemplo n.º 2
0
def test_has_with_base():
    stack = Metastack({'something': {'a_list': [1, 2], 'a_value': 5}})
    assert stack.has('something/a_list') == True
    assert stack.has('something/a_value') == True
    assert stack.has('something/does_not_exist') == False
Exemplo n.º 3
0
def test_has_top():
    stack = Metastack()
    stack._set_layer('identifier', {'something': 123})
    assert stack.has('something') == True
Exemplo n.º 4
0
def test_has_subpath():
    stack = Metastack()
    stack._set_layer('identifier', {'something': {'in': {'a': 'subpath'}}})
    assert stack.has('something/in/a') == True
Exemplo n.º 5
0
def test_has_no_subpath():
    stack = Metastack()
    stack._set_layer('identifier', {'something': {'in': {}}})
    assert stack.has('something/in/a/path') == False