Exemplo n.º 1
0
    def test_event_cycle(self):

        obj1 = AnyObject()
        obj2 = AnyObject()
        obj3 = AnyObject()

        init_events(obj1, obj2, obj3)

        self.assertFalse(connected(obj1, obj2))

        connect(obj1, obj2, 'attr')
        connect(obj2, obj3, 'attr')

        with self.assertRaises(EventCycleError):
            connect(obj3, obj1, 'attr')
Exemplo n.º 2
0
    def test_event_cycle(self):
        
        obj1 = AnyObject()
        obj2 = AnyObject()
        obj3 = AnyObject()
        
        init_events(obj1, obj2, obj3)
        
        self.assertFalse(connected(obj1, obj2))
        
        connect(obj1, obj2, 'attr')
        connect(obj2, obj3, 'attr')

        with self.assertRaises(EventCycleError):
            connect(obj3, obj1, 'attr')
Exemplo n.º 3
0
    def test_connected(self):

        obj1 = AnyObject()
        obj2 = AnyObject()
        obj3 = AnyObject()

        init_events(obj1, obj2, obj3)

        self.assertFalse(connected(obj1, obj2))

        connect(obj1, obj2, 'attr')
        self.assertTrue(connected(obj1, obj2))
        self.assertFalse(connected(obj2, obj1))

        connect(obj2, obj3, 'attr')
        self.assertTrue(connected(obj1, obj3))
        self.assertTrue(connected(obj2, obj3))
        self.assertFalse(connected(obj3, obj2))
        self.assertFalse(connected(obj3, obj1))
Exemplo n.º 4
0
 def test_connected(self):
     
     obj1 = AnyObject()
     obj2 = AnyObject()
     obj3 = AnyObject()
     
     init_events(obj1, obj2, obj3)
     
     self.assertFalse(connected(obj1, obj2))
     
     connect(obj1, obj2, 'attr')
     self.assertTrue(connected(obj1, obj2))
     self.assertFalse(connected(obj2, obj1))
     
     connect(obj2, obj3, 'attr')
     self.assertTrue(connected(obj1, obj3))
     self.assertTrue(connected(obj2, obj3))
     self.assertFalse(connected(obj3,obj2))
     self.assertFalse(connected(obj3, obj1))