def test_text(self): node = Node("category") self.assertIsNone(node.text) node = Node("category", ("This is text", 60)) self.assertEqual(node.text, "This is text") node.corr_text = "Text is corrected" self.assertEqual(node.text, "Text is corrected")
def apply_change(self, node: Node): """ Method used to apply a BackChange to a node :param node: the node which needs to be changed """ change = self.back_changes.get(self.tree_identifiers[id(node)], BackChange()) node.corr_text = change.text if isinstance(node, LabelNode): node.corr_label = change.label