예제 #1
0
 def test_eval_with_node(self):
     node = RootNode()
     combination = CombinationNode()
     combination.append(PrimitiveNode(add))
     combination.append(PrimitiveNode(1))
     combination.append(PrimitiveNode(2))
     node.append(combination)
     assert 3 == node.eval()
예제 #2
0
 def test_eval_without_node(self):
     node = RootNode()
     assert node.eval() is None