コード例 #1
0
 def test_ninth(self):
     result = self.t5_1.get_free_tree()
     self.assertEqual(self.t5_7, result.representative)
     self.assertEqual(1, result._rooted_trees[self.t5_1])
     self.assertFalse(result.superfluous)
     self.assertEqual(6, the_trees.index(result))
     self.assertEqual(4, the_trees.non_superfluous_index(result))
コード例 #2
0
 def test_tenth(self):
     result = self.t5_2.get_free_tree()
     self.assertEqual(self.t5_8, result.representative)
     self.assertEqual(1, result._rooted_trees[self.t5_2])
     self.assertFalse(result.superfluous)
     self.assertEqual(7, the_trees.index(result))
     self.assertEqual(5, the_trees.non_superfluous_index(result))
コード例 #3
0
 def test_eighth(self):
     result = self.t4_4.get_free_tree()
     self.assertEqual(self.t4_4, result.representative)
     self.assertEqual(1, result._rooted_trees[self.t4_4])
     self.assertFalse(result.superfluous)
     self.assertEqual(5, the_trees.index(result))
     self.assertEqual(3, the_trees.non_superfluous_index(result))
コード例 #4
0
 def test_third(self):
     result = self.t3_1.get_free_tree()
     self.assertEqual(self.t3_2, result.representative)
     self.assertEqual(-1, result._rooted_trees[self.t3_1])
     self.assertFalse(result.superfluous)
     self.assertEqual(3, the_trees.index(result))
     self.assertEqual(2, the_trees.non_superfluous_index(result))
コード例 #5
0
 def test_twelfth(self):
     result = self.t5_4.get_free_tree()
     self.assertEqual(self.t5_9, result.representative)
     self.assertEqual(-1, result._rooted_trees[self.t5_4])
     self.assertFalse(result.superfluous)
     self.assertEqual(8, the_trees.index(result))
     self.assertEqual(6, the_trees.non_superfluous_index(result))
コード例 #6
0
ファイル: test_unordered_tree.py プロジェクト: ravenwit/pybs
 def test_indexing(self):
     result = the_trees.index(self.t1_1)
     self.assertEqual(1, result)
     result = the_trees.index(self.t2_1)
     self.assertEqual(2, result)
     result = the_trees.index(self.t3_1)
     self.assertEqual(3, result)
     result = the_trees.index(self.t3_2)
     self.assertEqual(4, result)
     result = the_trees.index(self.t4_1)
     self.assertEqual(5, result)
     result = the_trees.index(self.t4_2)
     self.assertEqual(6, result)
     result = the_trees.index(self.t4_3)
     self.assertEqual(7, result)
     result = the_trees.index(self.t4_4)
     self.assertEqual(8, result)
     result = the_trees.index(self.t5_1)
     self.assertEqual(9, result)
     result = the_trees.index(self.t5_2)
     self.assertEqual(10, result)
     result = the_trees.index(self.t5_3)
     self.assertEqual(11, result)
     result = the_trees.index(self.t5_4)
     self.assertEqual(12, result)
     result = the_trees.index(self.t5_5)
     self.assertEqual(13, result)
     result = the_trees.index(self.t5_6)
     self.assertEqual(14, result)
     result = the_trees.index(self.t5_7)
     self.assertEqual(15, result)
     result = the_trees.index(self.t5_8)
     self.assertEqual(16, result)
     result = the_trees.index(self.t5_9)
     self.assertEqual(17, result)
コード例 #7
0
 def test_seventh(self):
     result = self.t4_3.get_free_tree()
     self.assertEqual(self.t4_3, result.representative)
     self.assertEqual(1, result._rooted_trees[self.t4_3])
     self.assertTrue(result.superfluous)
     self.assertEqual(4, the_trees.index(result))
コード例 #8
0
 def test_second(self):
     result = self.t2_1.get_free_tree()
     self.assertEqual(self.t2_1, result.representative)
     self.assertEqual(1, result._rooted_trees[self.t2_1])
     self.assertTrue(result.superfluous)
     self.assertEqual(2, the_trees.index(result))