#NEWLINE# def test_run_image_cache_manager_pass( self ) : #NEWLINE# #INDENT# was = { #NEWLINE# #INDENT# 'called' : False , #NEWLINE# #UNINDENT# } #NEWLINE# def fake_get_all_by_filters( context , * args , **kwargs ) : #NEWLINE# #INDENT# was [ 'called' ] = True #NEWLINE# instances = [ ] #NEWLINE# for x in range ( 2 ) : #NEWLINE# #INDENT# instances . append ( fake_instance . fake_db_instance ( image_ref = '1' , uuid = x , name = x , vm_state = '' , task_state = '' ) ) #NEWLINE# #UNINDENT# return instances #NEWLINE# #UNINDENT# with utils . tempdir ( ) as tmpdir : #NEWLINE# #INDENT# self . flags ( instances_path = tmpdir ) #NEWLINE# self . stub_out ( 'nova.db.instance_get_all_by_filters' , compute ) #NEWLINE# compute = importutils . import_object ( CONF . compute_manager ) #NEWLINE# self . flags ( use_local = True , group = 'conductor' ) #NEWLINE# compute . conductor_api = conductor . API ( ) #NEWLINE# ctxt = context . get_admin_context ( ) #NEWLINE# compute . _run_image_cache_manager_pass ( ctxt ) #NEWLINE# self . assertTrue ( was [ 'called' ] )