#NEWLINE# @ mock . patch . object ( volumeops . SMBFSVolumeDriver , 'ensure_share_mounted' ) #NEWLINE# @ mock . patch . object ( volumeops . SMBFSVolumeDriver , '_get_disk_path' ) #NEWLINE# def test_attach_non_existing_image( self , mock_get_disk_path , mock_ensure_share_mounted ) : #NEWLINE# #INDENT# self . _volume_driver . _vmutils . attach_drive . side_effect = os_win_exc . HyperVException #NEWLINE# self . assertRaises ( exception . VolumeAttachFailed , mock_get_disk_path . _volume_driver . attach_volume , self . _FAKE_CONNECTION_INFO , mock . sentinel . instance_name )