#NEWLINE# def test_select_destinations_no_valid_host( self ) : #NEWLINE# #INDENT# def _return_hosts( * args , **kwargs ) : #NEWLINE# #INDENT# return [ 'host1' , 'host2' ] #NEWLINE# #UNINDENT# def _return_no_host( * args , **kwargs ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# self . stub_out ( 'nova.scheduler.chance.ChanceScheduler.hosts_up' , spec_obj ) #NEWLINE# self . stub_out ( 'nova.scheduler.chance.ChanceScheduler._filter_hosts' , _return_no_host ) #NEWLINE# spec_obj = objects . RequestSpec ( num_instances = 1 ) #NEWLINE# self . assertRaises ( exception . NoValidHost , self . driver . select_destinations , self . context , spec_obj )