#NEWLINE# @ mock . patch ( 'nova.crypto.revoke_cert' ) #NEWLINE# def test_revoke_certs_by_user_and_project( self , mock_revoke ) : #NEWLINE# #INDENT# user_id = 'test_user' #NEWLINE# project_id = 2 #NEWLINE# file_name = 'test_file' #NEWLINE# def mock_certificate_get_all_by_user_and_project( context , user_id , project_id ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'user_id' : user_id , #NEWLINE# 'project_id' : project_id , #NEWLINE# 'file_name' : file_name , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# self . stub_out ( 'nova.db.certificate_get_all_by_user_and_project' , mock_certificate_get_all_by_user_and_project ) #NEWLINE# crypto . revoke_certs_by_user_and_project ( user_id , project_id ) #NEWLINE# mock_revoke . assert_called_once_with ( project_id , file_name )