Ejemplo n.º 1
0
def tree_with_some_nodes():
    t = Tree()
    t.append(Node('foo'))
    t.append(Node('bar'))
    t.append(Node('baz'))
    t[0].append(Node('sub1'))
    t[0].append(Node('sub2'))
    return t
Ejemplo n.º 2
0
def tree_with_some_nodes():
    t = Tree()
    t.append(Node('foo'))
    t.append(Node('bar'))
    t.append(Node('baz'))
    t[0].append(Node('sub1'))
    t[0].append(Node('sub2'))
    return t
Ejemplo n.º 3
0
def test_select_none_node():
    # setting selected_node to None clears the selection
    t = Tree()
    t.selected_node = None
    eq_(t.selected_nodes, [])
Ejemplo n.º 4
0
def test_select_none_path():
    # setting selected_path to None clears the selection
    t = Tree()
    t.selected_path = None
    assert t.selected_path is None
Ejemplo n.º 5
0
def test_find_none():
    # when find() yields no result, return None
    t = Tree()
    assert t.find(lambda n: False) is None  # no StopIteration exception
Ejemplo n.º 6
0
def test_select_none_node():
    # setting selected_node to None clears the selection
    t = Tree()
    t.selected_node = None
    eq_(t.selected_nodes, [])
Ejemplo n.º 7
0
def test_select_none_path():
    # setting selected_path to None clears the selection
    t = Tree()
    t.selected_path = None
    assert t.selected_path is None
Ejemplo n.º 8
0
def test_find_none():
    # when find() yields no result, return None
    t = Tree()
    assert t.find(lambda n: False) is None # no StopIteration exception