#NEWLINE# @ mock . patch ( 'nova.servicegroup.API' ) #NEWLINE# @ mock . patch ( 'nova.objects.service.Service.get_by_host_and_binary' ) #NEWLINE# @ mock . patch . object ( rpc , 'get_server' ) #NEWLINE# def test_service_stop_waits_for_rpcserver( self , mock_rpc , mock_svc_get_by_host_and_binary , mock_API ) : #NEWLINE# #INDENT# serv = service . Service ( self . host , self . binary , self . topic , 'nova.tests.unit.test_service.FakeManager' ) #NEWLINE# serv . start ( ) #NEWLINE# serv . stop ( ) #NEWLINE# serv . rpcserver . start . assert_called_once_with ( ) #NEWLINE# serv . rpcserver . stop . assert_called_once_with ( ) #NEWLINE# serv . rpcserver . wait . assert_called_once_with ( )