def test_second(self): result = subtrees(self.t2_1) expected = LinearCombination() expected[(self.et, self.t2_1)] = 1 expected[(Forest((self.t1_1, )), self.t1_1)] = 1 expected[(Forest((self.t2_1, )), self.et)] = 1 self.assertEqual(expected, result)
def test_fourth(self): result = subtrees(self.t3_2) expected = LinearCombination() expected[(Forest((self.t3_2, )), self.et)] = 1 expected[(Forest((self.t1_1, self.t1_1)), self.t1_1)] = 1 expected[(Forest((self.t1_1, )), self.t2_1)] = 2 expected[(self.et, self.t3_2)] = 1 self.assertEqual(expected, result)
def test_empty(self): result = subtrees(self.et) expected = LinearCombination() expected[(self.et, self.et)] = 1 self.assertEqual(expected, result)