#NEWLINE# def test_aggregate_ram_filter_conflict_values( self , agg_mock ) : #NEWLINE# #INDENT# spec_obj = objects . RequestSpec ( context = mock . sentinel . ctx , flavor = objects . Flavor ( memory_mb = 1024 ) ) #NEWLINE# host = fakes . FakeHostState ( 'host1' , 'node1' , { #NEWLINE# #INDENT# 'free_ram_mb' : 1023 , #NEWLINE# 'total_usable_ram_mb' : 1024 , #NEWLINE# 'ram_allocation_ratio' : 1.0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# agg_mock . return_value = set ( [ '1.5' , '2.0' ] ) #NEWLINE# self . assertTrue ( self . filt_cls . host_passes ( spec_obj , spec_obj ) ) #NEWLINE# self . assertEqual ( ( 1024 * 1.5 ) , host . limits [ 'memory_mb' ] )