Exemplo n.º 1
0
 def test_does_not_match_when_no_child_does(self):
     node = AndNode((FalseNode(), FalseNode()))
     result = node.match(())
     result |should| be(False)
Exemplo n.º 2
0
 def test_can_add_child_node(self):
     node = AndNode()
     node_1, node_2 = TrueNode(), FalseNode()
     node.add_child(node_1)
     node.add_child(node_2)
     node.child_nodes |should| be_equal_to([node_1, node_2])
Exemplo n.º 3
0
 def test_matches_when_all_child_nodes_do(self):
     node = AndNode((TrueNode(), TrueNode()))
     result = node.match(())
     result |should| be(True)
Exemplo n.º 4
0
 def test_does_not_match_when_no_child_does(self):
     node = AndNode((FalseNode(), FalseNode()))
     result = node.match(())
     result | should | be(False)
Exemplo n.º 5
0
 def test_can_add_child_node(self):
     node = AndNode()
     node_1, node_2 = TrueNode(), FalseNode()
     node.add_child(node_1)
     node.add_child(node_2)
     node.child_nodes | should | be_equal_to([node_1, node_2])
Exemplo n.º 6
0
 def test_matches_when_all_child_nodes_do(self):
     node = AndNode((TrueNode(), TrueNode()))
     result = node.match(())
     result | should | be(True)