3
Ydn                 @   s   d dl mZ d dlmZ d dljjZd dlZd dl	m
Z
 d dlZdd Zdd Zd	d
 Ze
jedede
jededdd ZdS )    )SGELikeBatchManagerBase)FunctionN)patchc               C   s
   t  d S )N)
ValueError r   r   \/var/www/html/virt/lib/python3.6/site-packages/nipype/pipeline/plugins/tests/test_sgelike.pycrasher	   s    r   c             C   s    |j  | jd< tjd|g dS )N   Zbash)
output_dirZ_pending
subprocesscall)selfZ
scriptfilenoder   r   r   submit_batchtask   s    r   c             C   s   dS )NFr   )r   Ztaskidr   r   r   
is_pending   s    r   Z_submit_batchtask)newZ_is_pendingc             C   s   t jdt| d}t| |jd d< |jt jttdddg td}t	j
t}|j|d	sdtW d Q R X t| jd
t| jd }t|dkstd S )Npipe)namebase_dirZ	executionZcrashdump_dir)functionr   )Z	interfacer    )Zpluginzcrash*crasher*.pklzzcrash*crasher*.txtr	   )peZWorkflowstrconfigZ	add_nodesNoder   r   r   pytestZraisesRuntimeErrorrunAssertionErrorlistgloblen)Ztmp_pathr   Zsgelike_plugineZ
crashfilesr   r   r   test_crashfile_creation   s    r#   )Znipype.pipeline.plugins.baser   Znipype.interfaces.utilityr   Znipype.pipeline.engineZpipelineZenginer   r   Zunittest.mockr   r   r   r   r   objectr#   r   r   r   r   <module>   s   