Beispiel #1
0
 def test_insert_2_2_level_items(self):
     tree = AggregateTreeNode()
     tree.add_interval(["a", "b"], self.t1, False)
     tree.add_interval(["x", "y"], self.t1, False)
     self.assertTreeEqual(tree, {"a": {"b": {"": None}}, "x": {"y": {"": None}}})
     tree.simplify()
     self.assertTreeEqual(tree, {"a b": None, "x y": None})
Beispiel #2
0
 def test_insert_2_3_level_items_with_common_levels_1_and_2(self):
     tree = AggregateTreeNode()
     tree.add_interval(["a", "b", "c"], self.t1, False)
     tree.add_interval(["a", "b", "d"], self.t1, False)
     self.assertTreeEqual(tree, {"a": {"b": {"c": {"": None}, "d": {"": None}}}})
     tree.simplify()
     self.assertTreeEqual(tree, {"a b": {"c": None, "d": None}})
Beispiel #3
0
 def test_insert_repeated_1_level_item(self):
     tree = AggregateTreeNode()
     tree.add_interval(["a"], self.t1, False)
     tree.add_interval(["a"], self.t1, False)
     self.assertTreeEqual(tree, {"a": {"": None}})
     tree.simplify()
     self.assertTreeEqual(tree, {"a": None})