#NEWLINE# def test_initialize_config( self , _initialize_config ) : #NEWLINE# #INDENT# config = { #NEWLINE# #INDENT# 'mycomponent' : { #NEWLINE# #INDENT# '__factory__' : 'palladium.tests.test_util.MyDummyComponent' , #NEWLINE# 'arg1' : 3 , #NEWLINE# 'arg2' : { #NEWLINE# #INDENT# 'no' : 'factory' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'subcomponent' : { #NEWLINE# #INDENT# '__factory__' : 'palladium.tests.test_util.MyDummyComponent' , #NEWLINE# 'arg1' : { #NEWLINE# #INDENT# 'subsubcomponent' : { #NEWLINE# #INDENT# '__factory__' : 'palladium.tests.test_util.MyDummyComponent' , #NEWLINE# 'arg1' : 'wobwob' , #NEWLINE# 'arg2' : 9 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'arg2' : 6 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'mylistofcomponents' : [ { #NEWLINE# #INDENT# '__factory__' : 'palladium.tests.test_util.MyDummyComponent' , #NEWLINE# 'arg1' : 'wobwob' , #NEWLINE# #UNINDENT# } , 'somethingelse' ] , #NEWLINE# 'myconstant' : 42 , #NEWLINE# #UNINDENT# } #NEWLINE# config = _initialize_config ( config ) #NEWLINE# assert ( config [ 'myconstant' ] == 42 ) #NEWLINE# mycomponent = config [ 'mycomponent' ] #NEWLINE# assert isinstance ( mycomponent , MyDummyComponent ) #NEWLINE# assert ( mycomponent . arg1 == 3 ) #NEWLINE# assert ( mycomponent . arg2 == { #NEWLINE# #INDENT# 'no' : 'factory' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( mycomponent . initialize_component_arg is config ) #NEWLINE# subcomponent = mycomponent . subcomponent #NEWLINE# assert isinstance ( subcomponent , MyDummyComponent ) #NEWLINE# assert ( subcomponent . arg2 == 6 ) #NEWLINE# assert ( subcomponent . initialize_component_arg is config ) #NEWLINE# subsubcomponent = subcomponent . arg1 [ 'subsubcomponent' ] #NEWLINE# assert isinstance ( subsubcomponent , MyDummyComponent ) #NEWLINE# assert ( subsubcomponent . arg1 == 'wobwob' ) #NEWLINE# assert ( subsubcomponent . arg2 == 9 ) #NEWLINE# assert ( subsubcomponent . initialize_component_arg is config ) #NEWLINE# mylistofcomponents = config [ 'mylistofcomponents' ] #NEWLINE# assert ( len ( mylistofcomponents ) == 2 ) #NEWLINE# assert isinstance ( mylistofcomponents [ 0 ] , MyDummyComponent ) #NEWLINE# assert ( self [ 0 ] . arg1 == 'wobwob' ) #NEWLINE# assert ( mylistofcomponents [ 1 ] == 'somethingelse' )