3
Ydp                 @   s   d dl m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ejjed	dkd
dejjddd ZdS )    )whichNc               @   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   X/var/www/html/virt/lib/python3.6/site-packages/nipype/pipeline/plugins/tests/test_pbs.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 )PbsTestInterfacec             C   s
   d|_ |S )Nr   )
returncode)selfZruntimer   r   r   _run_interface   s    zPbsTestInterface._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PbsTestInterface._list_outputsN)	r   r   r   r   Z
input_specr   Zoutput_specr   r   r   r   r   r   r      s   r   ZqsubzPBS not installed)reason<   c             C   s   t jdt| d}t jt dd}t jt dgdd}|j||dgfg 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base_dirmod1)	interfacer   r   mod2)r    Z	iterfieldr   r   r   ZPBSGraph)Zpluginc             S   s   g | ]}d j |j|jfqS ).)joinZ
_hierarchyr   ).0noder   r   r   
<listcomp>)   s    z%test_run_pbsgraph.<locals>.<listcomp>z	pipe.mod1)r   r   )peZWorkflowstrNoder   ZMapNodeconnectr   r   runZnodeslistindexZ
get_outputAssertionError)Ztmp_pathr   r   r!   Z	execgraphnamesr%   resultr   r   r   test_run_pbsgraph    s    
r1   )shutilr   Znipype.interfaces.baseZ
interfacesbaser   ZpytestZnipype.pipeline.engineZpipelineZenginer'   ZTraitedSpecr   r   ZBaseInterfacer   markZskipiftimeoutr1   r   r   r   r   <module>   s   