#NEWLINE# @ ddt . data ( 1 , 5 ) #NEWLINE# def test_list_objects_in_containers( self , num_cons ) : #NEWLINE# #INDENT# con_list = [ { #NEWLINE# #INDENT# 'name' : ( 'cooon_%s' % i ) , #NEWLINE# #UNINDENT# } for i in range ( num_cons ) ] #NEWLINE# scenario = objects . SwiftObjects ( ) #NEWLINE# scenario . _list_containers = mock . MagicMock ( return_value = ( 'header' , con_list ) ) #NEWLINE# scenario . _list_objects = mock . MagicMock ( ) #NEWLINE# scenario . list_objects_in_containers ( ) #NEWLINE# scenario . _list_containers . assert_called_once_with ( ) #NEWLINE# con_calls = [ mock . call ( container [ 'name' ] , atomic_action = False ) for container in con_list ] #NEWLINE# scenario . _list_objects . assert_has_calls ( con_calls ) #NEWLINE# key_suffix = 'container' #NEWLINE# if ( num_cons > 1 ) : #NEWLINE# #INDENT# key_suffix = ( '%i_containers' % num_cons ) #NEWLINE# #UNINDENT# self . _test_atomic_action_timer ( scenario . atomic_actions ( ) , ( 'swift.list_objects_in_%s' % key_suffix ) )