#NEWLINE# @ mock . patch ( 'nova.virt.libvirt.host.Host.find_secret' ) #NEWLINE# def test_delete_secret( self , mock_find_secret ) : #NEWLINE# #INDENT# 'deleting secret.' #NEWLINE# secret = mock . MagicMock ( ) #NEWLINE# mock_find_secret . return_value = secret #NEWLINE# expected = [ mock . call ( 'rbd' , 'rbdvol' ) , mock . call ( ) . undefine ( ) ] #NEWLINE# self . host . delete_secret ( 'rbd' , 'rbdvol' ) #NEWLINE# self . assertEqual ( expected , mock_find_secret . mock_calls ) #NEWLINE# mock_find_secret . return_value = None #NEWLINE# self . host . delete_secret ( 'rbd' , 'rbdvol' )