示例#1
0
 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")
示例#2
0
 def test_state_item(self):
     node = Node(pa="1")
     self.assertEqual(node.state, "item")
     node.closed = True
     self.assertEqual(node.state, "item")
示例#3
0
 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")