Beispiel #1
0
def test_follow_nested(patch, tree):
    bar = Tree('bar', [])
    foo = Tree('foo', [bar])
    m = Tree('mock', [foo])
    assert m.follow(['foo', 'bar']) is bar
Beispiel #2
0
def test_follow_first(patch, tree):
    foo = Tree('foo', [])
    m = Tree('mock', [foo])
    assert m.follow(['foo']) is foo
Beispiel #3
0
def test_follow_multiple(patch, tree):
    foo = Tree('foo', [])
    bar = Tree('bar', [])
    m = Tree('mock', [foo, bar])
    assert m.follow(['foo']) is None
Beispiel #4
0
def test_follow_empty(patch, tree):
    m = Tree('mock', [])
    assert m.follow(['foo']) is None
Beispiel #5
0
def test_follow_nested(patch, tree):
    bar = Tree("bar", [])
    foo = Tree("foo", [bar])
    m = Tree("mock", [foo])
    assert m.follow(["foo", "bar"]) is bar
Beispiel #6
0
def test_follow_multiple(patch, tree):
    foo = Tree("foo", [])
    bar = Tree("bar", [])
    m = Tree("mock", [foo, bar])
    assert m.follow(["foo"]) is None
Beispiel #7
0
def test_follow_first(patch, tree):
    foo = Tree("foo", [])
    m = Tree("mock", [foo])
    assert m.follow(["foo"]) is foo
Beispiel #8
0
def test_follow_empty(patch, tree):
    m = Tree("mock", [])
    assert m.follow(["foo"]) is None