3
Yd                 @   sB   d Z ddlZddljZddlZddlmZ ddl	m
Z
 dd ZdS )zTests for the engine module
    N)mock)report_crashc              C   s   t jdt j } t jdt j d d| _t jdd}d|_ddd	d
i|_t|}tjd}|j	|j
 |kstt| jdkstW d Q R X W d Q R X d S )Nzpickle.dumpz.nipype.pipeline.plugins.tools.format_exceptionT	mock_node)nameZan_idZ	execution.Zpklz)Zcrashdump_dirZcrashfile_formatz".*/crash-.*-an_id-[0-9a-f\-]*.pklz   )r   patchZ	MagicMockZreturn_value_idconfigr   recompilematchgroupAssertionErrorZ
call_count)Zmock_pickle_dumpr   Zactual_crashfileZexpected_crashfile r   Z/var/www/html/virt/lib/python3.6/site-packages/nipype/pipeline/plugins/tests/test_tools.pytest_report_crash   s    
r   )__doc__ZnumpynpZscipy.sparsesparseZsspr   Zunittestr   Znipype.pipeline.plugins.toolsr   r   r   r   r   r   <module>   s   
.