Example #1
0
def test_tree_first_child_empty():
    tree = Tree('rule', [])
    with raises(AssertionError):
        tree.first_child()
Example #2
0
def test_tree_first_child_multiple():
    tree = Tree('rule', ['child', 'child2'])
    assert tree.first_child() == 'child'
Example #3
0
def test_tree_first_child_multiple():
    tree = Tree("rule", ["child", "child2"])
    assert tree.first_child() == "child"
Example #4
0
def test_tree_first_child():
    tree = Tree('rule', ['child'])
    assert tree.first_child() == 'child'
Example #5
0
def test_tree_first_child():
    tree = Tree("rule", ["child"])
    assert tree.first_child() == "child"