#NEWLINE# @ mock . patch ( 'rally.task.types.ResourceType.get' , create = True ) #NEWLINE# def test_convert_multiple( self , mock_resource_type_get ) : #NEWLINE# #INDENT# loaders = { #NEWLINE# #INDENT# 'test_bar' : mock . Mock ( ) , #NEWLINE# 'test_baz' : mock . Mock ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# mock_resource_type_get . side_effect = ( lambda p : loaders [ p ] ) #NEWLINE# args = types . preprocess ( 'TestConvertPlugin.two_args' , mock . MagicMock ( ) , { #NEWLINE# #INDENT# 'bar' : 'bar_config' , #NEWLINE# 'baz' : 'baz_config' , #NEWLINE# #UNINDENT# } ) #NEWLINE# mock_resource_type_get . assert_has_calls ( [ mock . call ( 'test_bar' ) , mock . call ( 'test_baz' ) ] , any_order = True ) #NEWLINE# loaders [ 'test_bar' ] . transform . assert_called_once_with ( clients = mock . ANY , resource_config = 'bar_config' ) #NEWLINE# loaders [ 'test_baz' ] . transform . assert_called_once_with ( clients = mock . ANY , resource_config = 'baz_config' ) #NEWLINE# self . assertDictEqual ( loaders , { #NEWLINE# #INDENT# 'bar' : loaders [ 'test_bar' ] . transform . return_value , #NEWLINE# 'baz' : loaders [ 'test_baz' ] . transform . return_value , #NEWLINE# #UNINDENT# } )