示例#1
0
文件: test.py 项目: sdeleon28/ai
 def test_creates_max_nodes_from_tuple(self):
     result = MinNode.from_tuple(self.test_tuple)
     self.assertEqual(INF, result.value)
     child1, child2 = result.children
     self.assertIsInstance(child1, MaxNode)
     self.assertEqual(self.child1_value, child1.value)
     self.assertIsInstance(child2, MaxNode)
     self.assertEqual(self.child2_value, child2.value)
示例#2
0
文件: test.py 项目: sdeleon28/ai
 def test_min_node_returns_child_when_visited(self):
     node = MinNode.from_tuple(self.test_tuple)
     self.assertEqual(self.small_child_value, node.visit())