#NEWLINE# @ mock . patch ( 'nova.cells.messaging._TargetedMessage' ) #NEWLINE# def test_rebuild_sig( self , mock_msg ) : #NEWLINE# #INDENT# def wire( version ) : #NEWLINE# #INDENT# cells_mgr = manager . CellsManager ( ) #NEWLINE# def cast( context , method , * args , **kwargs ) : #NEWLINE# #INDENT# fn = getattr ( cells_mgr , method ) #NEWLINE# fn ( context , * args , ** kwargs ) #NEWLINE# #UNINDENT# cells_mgr . cast = cast #NEWLINE# return cells_mgr #NEWLINE# #UNINDENT# cells_rpcapi = self . compute_api . cells_rpcapi #NEWLINE# client = cells_rpcapi . client #NEWLINE# with mock . patch . object ( client , 'prepare' , side_effect = wire ) : #NEWLINE# #INDENT# inst = self . _create_fake_instance_obj ( ) #NEWLINE# inst . cell_name = 'mycell' #NEWLINE# cells_rpcapi . rebuild_instance ( self . context , inst , 'pass' , None , None , None , None , None , recreate = False , on_shared_storage = False , host = 'host' , preserve_ephemeral = True , kwargs = None ) #NEWLINE# #UNINDENT# self . assertEqual ( 1 , mock_msg . call_count )