def test_creates_min_nodes_from_tuple(self): result = MaxNode.from_tuple(self.test_tuple) self.assertEqual(-INF, result.value) child1, child2 = result.children self.assertIsInstance(child1, MinNode) self.assertEqual(self.child1_value, child1.value) self.assertIsInstance(child2, MinNode) self.assertEqual(self.child2_value, child2.value)
def test_max_node_returns_big_child_when_visited(self): node = MaxNode.from_tuple(self.test_tuple) self.assertEqual(self.big_child_value, node.visit())