def test_state(self): node = Node(pa="A", id="B") self.assertEqual(node.state, "item") node.complete = True self.assertEqual(node.state, "complete_item") node.children.append("CHILD") self.assertEqual(node.state, "complete_parent") node.complete = False self.assertEqual(node.state, "open") node.closed = True self.assertEqual(node.state, "closed")
def test_state_item(self): node = Node(pa="1") self.assertEqual(node.state, "item") node.closed = True self.assertEqual(node.state, "item")
def test_state_open_closed(self): node = Node(pa="1", ch=["0"]) self.assertEqual(node.state, "open") node.closed = True self.assertEqual(node.state, "closed")