#NEWLINE# @ mock . patch . object ( greenthread , 'sleep' ) #NEWLINE# def test_unplug_vbd_works( self , mock_sleep ) : #NEWLINE# #INDENT# session = _get_fake_session ( ) #NEWLINE# vbd_ref = 'vbd_ref' #NEWLINE# vm_ref = 'vm_ref' #NEWLINE# vm_utils . unplug_vbd ( session , self , vm_ref ) #NEWLINE# session . call_xenapi . assert_called_once_with ( 'VBD.unplug' , vbd_ref ) #NEWLINE# self . assertEqual ( 0 , mock_sleep . call_count )