#NEWLINE# def test_addObserverTwice( self ) : #NEWLINE# #INDENT# '\n        Test adding two observers for the same query.\n\n        When the event is dispath both of the observers need to be called.\n        ' #NEWLINE# d = EventDispatcher ( ) #NEWLINE# cb1 = CallbackTracker ( ) #NEWLINE# cb2 = CallbackTracker ( ) #NEWLINE# d . addObserver ( '//event/testevent' , cb1 . call ) #NEWLINE# d . addObserver ( '//event/testevent' , cb2 . call ) #NEWLINE# d . dispatch ( d , '//event/testevent' ) #NEWLINE# self . assertEquals ( cb1 . called , 1 ) #NEWLINE# self . assertEquals ( cb2 . obj , d ) #NEWLINE# self . assertEquals ( cb2 . called , 1 ) #NEWLINE# self . assertEquals ( cb2 . obj , d )