#NEWLINE# def test_dynamically_added_category( self ) : #NEWLINE# #INDENT# ' dynamically added category ' #NEWLINE# from envisage.core_plugin import CorePlugin #NEWLINE# class PluginA ( Plugin ) : #NEWLINE# #INDENT# id = 'A' #NEWLINE# categories = List ( contributes_to = 'envisage.categories' ) #NEWLINE# def _categories_default( self ) : #NEWLINE# #INDENT# ' Trait initializer. ' #NEWLINE# bar_category = Category ( class_name = ( PKG + '.bar_category.BarCategory' ) , target_class_name = ( CorePluginTestCase . __module__ + '.Bar' ) ) #NEWLINE# return [ bar_category ] #NEWLINE# #UNINDENT# #UNINDENT# core = CorePlugin ( ) #NEWLINE# a = PluginA ( ) #NEWLINE# application = TestApplication ( plugins = [ core ] ) #NEWLINE# application . start ( ) #NEWLINE# application . add_plugin ( a ) #NEWLINE# class Bar ( HasTraits ) : #NEWLINE# #INDENT# x = Int #NEWLINE# #UNINDENT# self . assert_ ( ( 'y' in Bar . class_traits ( ) ) ) #NEWLINE# return