Exemplo n.º 1
0
 def test_circular2(self):
     """
     Verify that a circular dependency among 2 objects is detected.
     """
     o1 = Identity()
     o2 = Identity()
     o1.depends_on = ["o2"]
     o2.depends_on = ["o1"]
     o1.o2 = o2
     o2.o1 = o1
     with self.assertRaises(RuntimeError):
         get_owners(o1)
Exemplo n.º 2
0
 def test_circular4(self):
     """
     Verify that a circular dependency among 4 objects is detected.
     """
     o1 = Identity()
     o2 = Identity()
     o3 = Identity()
     o4 = Identity()
     o1.depends_on = ["o2"]
     o2.depends_on = ["o3"]
     o3.depends_on = ["o4"]
     o4.depends_on = ["o1"]
     o1.o2 = o2
     o2.o3 = o3
     o3.o4 = o4
     o4.o1 = o1
     with self.assertRaises(RuntimeError):
         get_owners(o1)