#NEWLINE# @ mock . patch . object ( volumeops . SMBFSVolumeDriver , 'ensure_share_mounted' ) #NEWLINE# @ mock . patch . object ( volumeops . SMBFSVolumeDriver , '_get_disk_path' ) #NEWLINE# def _check_attach_volume( self , mock_get_disk_path , mock_ensure_share_mounted , ebs_root = False ) : #NEWLINE# #INDENT# mock_get_disk_path . return_value = mock . sentinel . disk_path #NEWLINE# self . _volume_driver . attach_volume ( self . _FAKE_CONNECTION_INFO , mock . sentinel . instance_name , ebs_root ) #NEWLINE# if ebs_root : #NEWLINE# #INDENT# get_vm_ide_controller = self . _volume_driver . _vmutils . get_vm_ide_controller #NEWLINE# get_vm_ide_controller . assert_called_once_with ( mock . sentinel . instance_name , 0 ) #NEWLINE# ctrller_path = self . return_value #NEWLINE# slot = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# get_vm_scsi_controller = self . _volume_driver . _vmutils . get_vm_scsi_controller #NEWLINE# get_vm_scsi_controller . assert_called_once_with ( mock . sentinel . instance_name ) #NEWLINE# get_free_controller_slot = self . _volume_driver . _vmutils . get_free_controller_slot #NEWLINE# get_free_controller_slot . assert_called_once_with ( get_vm_scsi_controller . return_value ) #NEWLINE# ctrller_path = get_vm_scsi_controller . return_value #NEWLINE# slot = get_free_controller_slot . return_value #NEWLINE# #UNINDENT# mock_ensure_share_mounted . assert_called_once_with ( self . _FAKE_CONNECTION_INFO ) #NEWLINE# mock_get_disk_path . assert_called_once_with ( self . _FAKE_CONNECTION_INFO ) #NEWLINE# self . _volume_driver . _vmutils . attach_drive . assert_called_once_with ( mock . sentinel . instance_name , mock . sentinel . disk_path , ctrller_path , slot )