#NEWLINE# def test_catch_data_add_component_message( self ) : #NEWLINE# #INDENT# 'DerviedAttributes added to a dataset in a collection\n        should generate messages that the collection catches.\n        ' #NEWLINE# d = Data ( ) #NEWLINE# id1 = ComponentID ( 'id1' ) #NEWLINE# id2 = ComponentID ( 'id2' ) #NEWLINE# link = ComponentLink ( [ id1 ] , id2 ) #NEWLINE# dc = DerivedComponent ( d , link ) #NEWLINE# self . dc . append ( d ) #NEWLINE# d . add_component ( Component ( np . array ( [ 1 , 2 , 3 ] ) ) , id1 ) #NEWLINE# assert ( not ( link in self . dc . _link_manager ) ) #NEWLINE# d . add_component ( self , id2 ) #NEWLINE# msg = self . log . messages [ ( - 1 ) ] #NEWLINE# assert isinstance ( msg , ComponentsChangedMessage ) #NEWLINE# assert ( link in self . dc . _link_manager )