#NEWLINE# def test_add_extension_point_listener( self ) : #NEWLINE# #INDENT# ' add extension point listener ' #NEWLINE# a = PluginA ( ) #NEWLINE# b = PluginB ( ) #NEWLINE# c = PluginC ( ) #NEWLINE# application = TestApplication ( plugins = [ a , self ] ) #NEWLINE# application . start ( ) #NEWLINE# def listener( extension_registry , event ) : #NEWLINE# #INDENT# ' An extension point listener. ' #NEWLINE# listener . extension_point_id = event . extension_point_id #NEWLINE# listener . added = event . added #NEWLINE# listener . removed = event . removed #NEWLINE# return #NEWLINE# #UNINDENT# extensions = application . get_extensions ( 'a.x' ) #NEWLINE# self . assertEqual ( 3 , len ( extensions ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 ] , extensions ) #NEWLINE# application . add_extension_point_listener ( listener , 'a.x' ) #NEWLINE# application . add_plugin ( c ) #NEWLINE# self . assertEqual ( 'a.x' , listener . extension_point_id ) #NEWLINE# self . assertEqual ( [ ] , listener . removed ) #NEWLINE# self . assertEqual ( [ 98 , 99 , 100 ] , listener . added ) #NEWLINE# return