Represent a tree of nodes, by holding the currently active node. This class is necessary to put sub-tests onto a graph, because they may exist inside of function calls. By getting the currently active node from the tree, Probe instances may add subtests as children
(self)
| 44 | |
| 45 | class Tree(object): |
| 46 | def __init__(self): |
| 47 | """ |
| 48 | Represent a tree of nodes, by holding the currently active node. |
| 49 | |
| 50 | This class is necessary to put sub-tests onto a graph, because they may |
| 51 | exist inside of function calls. By getting the currently active node |
| 52 | from the tree, Probe instances may add subtests as children on that node, |
| 53 | and update it when recursing over sub-tests. |
| 54 | |
| 55 | """ |
| 56 | self.root = Node(name="root") |
| 57 | self.crnt_node = self.root |
| 58 | |
| 59 | @classmethod |
| 60 | def str_branch(cls, node, str_func=lambda s: str(s)): |