3
Yd                 @   s   d dl Z d dlmZ d dljjZd dlZd dlj	j
Zd dlmZ G dd dejZG dd dejZG dd	 d	ejZejjed
ddd ZdS )    N)sleep)soma_not_loadedc               @   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   ]/var/www/html/virt/lib/python3.6/site-packages/nipype/pipeline/plugins/tests/test_somaflow.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 )SomaTestInterfacec             C   s
   d|_ |S )Nr   )
returncode)selfZruntimer   r   r   _run_interface   s    z SomaTestInterface._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SomaTestInterface._list_outputsN)	r   r   r   r   Z
input_specr   Zoutput_specr   r   r   r   r   r   r      s   r   zsoma not loaded)reasonc             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
_|jd
d}dd |j D }t|j |jd }|jd}|d	d	gkstd S )Npipe)namemod1)	interfacer   r   mod2)r   Z	iterfieldr   r   r   ZSomaFlow)Zpluginc             S   s   g | ]}d j |j|jfqS ).)joinZ
_hierarchyr   ).0noder   r   r   
<listcomp>.   s    z%test_run_somaflow.<locals>.<listcomp>z	pipe.mod1)r   r   )chdirpeZWorkflowNoder   ZMapNodeconnectosgetcwdbase_dirr   r   runZnodeslistindexZ
get_outputAssertionError)Ztmpdirr   r   r    Z	execgraphnamesr$   resultr   r   r   test_run_somaflow#   s    

r3   )r*   timer   Znipype.interfaces.baseZ
interfacesbaser	   ZpytestZnipype.pipeline.engineZpipelineZenginer'   Z nipype.pipeline.plugins.somaflowr   ZTraitedSpecr   r   ZBaseInterfacer   markZskipifr3   r   r   r   r   <module>   s   