3
YdM                 @   sr   d dl Z d dljjZd dlZd dljjZ	G dd dej
ZG dd dej
ZG dd dejZdd	 Zd
d ZdS )    Nc               @   s(   e Zd ZejjddZejjddZdS )	InputSpecza random int)descN)__name__
__module____qualname__nibtraitsIntinput1Zinput2 r   r   Z/var/www/html/virt/lib/python3.6/site-packages/nipype/pipeline/plugins/tests/test_debug.pyr   	   s   r   c               @   s    e Zd ZejjejjddZdS )
OutputSpecoutputs)r   N)r   r   r   r   r   Listr	   output1r   r   r   r   r      s   r   c               @   s$   e Zd ZeZeZdd Zdd ZdS )DebugTestInterfacec             C   s
   d|_ |S )Nr   )
returncode)selfZruntimer   r   r   _run_interface   s    z!DebugTestInterface._run_interfacec             C   s    | j  j }d| jjg|d< |S )N   r   )Z_outputsgetinputsr
   )r   r   r   r   r   _list_outputs   s    z DebugTestInterface._list_outputsN)	r   r   r   r   Z
input_specr   Zoutput_specr   r   r   r   r   r   r      s   r   c             C   s   d S )Nr   )nodegraphr   r   r   callme    s    r   c                s   | j   tjdd tjt dd}tjt dgdd} j||dgfg tj  _	d|j
_ fd	d
}tjt |  W d Q R X d }y jddtid W n& tk
r } z
|}W Y d d }~X nX |d kstdd S )Npipe)namemod1r
   mod2)Z	iterfieldr   r   r   c                  s    j ddS )NDebug)plugin)runr   )r   r   r   <lambda>/   s    ztest_debug.<locals>.<lambda>r    callable)r!   Zplugin_argszunexpected exception caught)r   r
   )chdirpeZWorkflowNoder   ZMapNodeconnectosgetcwdbase_dirr   r
   pytestZraises
ValueErrorr"   r   	ExceptionAssertionError)Ztmpdirr   r   Zrun_wfexcer   )r   r   
test_debug$   s     
r2   )r)   Znipype.interfaces.baseZ
interfacesbaser   r,   Znipype.pipeline.engineZpipelineZenginer&   ZTraitedSpecr   r   ZBaseInterfacer   r   r2   r   r   r   r   <module>   s   