Exemplo n.º 1
0
 def test_graph1(self):
     node = DepthLimitedSearchTest.prepare_graph1()
     result = dls(node, '1', 2)
     self.assertTrue(result.value == '1')
Exemplo n.º 2
0
 def test_tree5(self):
     node = DepthLimitedSearchTest.prepare_single_node_tree()
     result = dls(node, '2', 0)
     self.assertTrue(result is None)
Exemplo n.º 3
0
 def test_tree_with_comparator1(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, 5, 5, comparator=lambda x, y: int(x) == y)
     self.assertTrue(result.value == '5')
Exemplo n.º 4
0
 def test_tree2(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, '7', 10)
     self.assertTrue(result is None)
Exemplo n.º 5
0
 def test_tree3(self):
     node = DepthLimitedSearchTest.prepare_single_node_tree()
     result = dls(node, '1', 0)
     self.assertTrue(result.value == '1')
Exemplo n.º 6
0
 def test_graph6(self):
     node = DepthLimitedSearchTest.prepare_graph1()
     result = dls(node, '6', 2)
     self.assertTrue(result is None)
Exemplo n.º 7
0
 def test_tree1(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, '5', 10)
     self.assertTrue(result.value == '5')
Exemplo n.º 8
0
 def test_tree_with_comparator1(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, 5, 5, comparator=lambda x, y: int(x) == y)
     self.assertTrue(result.value == '5')
Exemplo n.º 9
0
 def test_graph1(self):
     node = DepthLimitedSearchTest.prepare_graph1()
     result = dls(node, '1', 2)
     self.assertTrue(result.value == '1')
Exemplo n.º 10
0
 def test_tree5(self):
     node = DepthLimitedSearchTest.prepare_single_node_tree()
     result = dls(node, '2', 0)
     self.assertTrue(result is None)
Exemplo n.º 11
0
 def test_tree3(self):
     node = DepthLimitedSearchTest.prepare_single_node_tree()
     result = dls(node, '1', 0)
     self.assertTrue(result.value == '1')
Exemplo n.º 12
0
 def test_tree2(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, '7', 10)
     self.assertTrue(result is None)
Exemplo n.º 13
0
 def test_tree1(self):
     node = DepthLimitedSearchTest.prepare_tree1()
     result = dls(node, '5', 10)
     self.assertTrue(result.value == '5')
Exemplo n.º 14
0
 def test_graph6(self):
     node = DepthLimitedSearchTest.prepare_graph1()
     result = dls(node, '6', 2)
     self.assertTrue(result is None)