#NEWLINE# def test_filter_datastores_by_hubs( self ) : #NEWLINE# #INDENT# ds_values = [ ] #NEWLINE# datastores = [ ] #NEWLINE# for i in range ( 0 , 10 ) : #NEWLINE# #INDENT# value = ( 'ds-%d' % i ) #NEWLINE# ds_values . append ( value ) #NEWLINE# datastores . append ( self . _create_datastore ( value ) ) #NEWLINE# #UNINDENT# hubs = [ ] #NEWLINE# hub_ids = ds_values [ 0 : int ( ( len ( ds_values ) / 2 ) ) ] #NEWLINE# for hub_id in hub_ids : #NEWLINE# #INDENT# hub = mock . Mock ( ) #NEWLINE# hub . hubId = hub_id #NEWLINE# hubs . append ( hub ) #NEWLINE# #UNINDENT# filtered_ds = pbm . filter_datastores_by_hubs ( hubs , datastores ) #NEWLINE# self . assertEqual ( len ( hubs ) , len ( filtered_ds ) ) #NEWLINE# filtered_ds_values = [ ds . value for ds in filtered_ds ] #NEWLINE# self . assertEqual ( set ( hub_ids ) , set ( filtered_ds_values ) )