Exemple #1
0
 def testEvents(self):
     r = Rectangle( size = (1, 3) )
     
     # see if the model changes an event when its data changes
     cc = CallChecker( object = r, attributeName = 'size', oldAttributeValue = (1, 3), newAttributeValue = (7, 9) )
     events.subscribe( 'modelChanged', cc )
     r.size = (7, 9)
Exemple #2
0
    def testEvents(self):
        r = Rectangle(size=(1, 3))

        # see if the model changes an event when its data changes
        cc = CallChecker(object=r,
                         attributeName='size',
                         oldAttributeValue=(1, 3),
                         newAttributeValue=(7, 9))
        events.subscribe('modelChanged', cc)
        r.size = (7, 9)
Exemple #3
0
    def testAll(self):
        events.send( 'testEvent', value1 = 1 )
        
        callChecker = CallChecker( value1 = 1 )
        events.subscribe( callChecker, 'testEvent',  )
        events.send( 'testEvent', value1 = 1 )
        callChecker.verify(self)        

        events.unsubscribe( callChecker, 'testEvent' )
        callChecker.verifyNotCalled(self)     

        events.subscribe( callChecker.receiveKeywords, 'testEvent' )
        events.send( 'testEvent', value1 = 1 )
        callChecker.verifyKeywords(self)        
Exemple #4
0
    def testAll(self):
        events.send('testEvent', value1=1)

        callChecker = CallChecker(value1=1)
        events.subscribe(
            callChecker,
            'testEvent',
        )
        events.send('testEvent', value1=1)
        callChecker.verify(self)

        events.unsubscribe(callChecker, 'testEvent')
        callChecker.verifyNotCalled(self)

        events.subscribe(callChecker.receiveKeywords, 'testEvent')
        events.send('testEvent', value1=1)
        callChecker.verifyKeywords(self)