Пример #1
0
 def test_ancestors(self):
     a = []
     b = []
     c = []
     d = []
     a.append(b)
     a.append(c)
     b.append(d)
     c.append(d)
     graph = ObjectGraph([a, b, c, d])
     self.assertCountEqual(graph.ancestors(a), [a])
     self.assertCountEqual(graph.ancestors(b), [b, a])
     self.assertCountEqual(graph.ancestors(c), [c, a])
     self.assertCountEqual(graph.ancestors(d), [d, b, c, a])