#NEWLINE# def test_should_collect_single_initializer_with_environments( self ) : #NEWLINE# #INDENT# def init( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# setattr ( execution_manager_mock , INITIALIZER_ATTRIBUTE , True ) #NEWLINE# setattr ( init , ENVIRONMENTS_ATTRIBUTE , [ 'any_environment' ] ) #NEWLINE# module = ModuleType ( 'mock_module' ) #NEWLINE# module . task = init #NEWLINE# class ExecutionManagerMock ( object ) : #NEWLINE# #INDENT# def register_initializer( self , initializer ) : #NEWLINE# #INDENT# self . initializer = initializer #NEWLINE# #UNINDENT# def register_late_task_dependencies( self , dependencies ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# execution_manager_mock = ExecutionManagerMock ( ) #NEWLINE# self . reactor . execution_manager = execution_manager_mock #NEWLINE# self . reactor . collect_tasks_and_actions_and_initializers ( module ) #NEWLINE# self . assertEquals ( execution_manager_mock . initializer . environments , [ 'any_environment' ] )