File: TestDepthFirstDecorator.py

package info (click to toggle)
uranium 5.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,304 kB
  • sloc: python: 31,765; sh: 132; makefile: 12
file content (24 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Scene.SceneNode import SceneNode


def test_DepthFirstIterator():

    root_node = SceneNode()

    node_1 = SceneNode()
    root_node.addChild(node_1)

    node_1_child_1 = SceneNode()
    node_1_child_2 = SceneNode()

    node_1.addChild(node_1_child_1)
    node_1.addChild(node_1_child_2)

    node_2 = SceneNode()
    root_node.addChild(node_2)

    node_2_child_1 = SceneNode()
    node_2.addChild(node_2_child_1)

    assert list(DepthFirstIterator(root_node)) == [root_node, node_1, node_2, node_1_child_1, node_1_child_2, node_2_child_1]