def setUp(self): self.added_nodes = 0 self.deleted_nodes = 0 self.tree = MainTree() self.filtersbank = FiltersBank(self.tree) self.filtered_tree = FilteredTree(self.tree, self.filtersbank) self.tree.add_node(_Node(node_id="apple")) self.tree.add_node(_Node(node_id="google")) self.filtered_tree.set_callback('deleted', self.deleted) self.filtered_tree.set_callback('added', self.added)
def __init__(self): """ Initialize MainTree. @param root - the "root" node which contains all nodes """ self.nodes = {} self.pending_relationships = [] self.__cllbcks = {} self.root_id = 'root' self.root = _Node(self.root_id) _Node._set_tree(self.root,self) self._queue = processqueue.SyncQueue()
def __init__(self): """ Initialize MainTree. @param root - the "root" node which contains all nodes """ self.nodes = {} self.pending_relationships = [] self.__cllbcks = {} self.root_id = 'root' self.root = _Node(self.root_id) _Node._set_tree(self.root, self) self._queue = processqueue.SyncQueue()