3
rd                 @   s  d dl mZ d dljZddlmZ ejeje	Z
ejejeje	dZee eedZejjdZejdZejd	Zejd
ZejdZejjdZejdZejdZejdZejdZedd Zedd Z edd Z!edd Z"edd Z#edd Z$edd Z%edd  Z&ed!d" Z'ed#d$ Z(ed%d& Z)ed'd( Z*ed)d* Z+ed+d, Z,ed-d. Z-ed/d0 Z.dS )1    )	InterfaceN   )skip_if_no_networkzcentral.cfg)configZsurfmask_smpl2ZCENTRAL05_S01120ZCENTRAL05_E02681Z11Zobscure_algorithm_outputZNFBZBOAZGHJZJKLZIOPc               C   s*   t j r&tt tsttt dks&td S )Nz<Project Object> NFB)proj_1exists
isinstanceobjectAssertionErrorstr r   r   9/tmp/pip-build-7vycvbft/pyxnat/pyxnat/tests/repr_tests.pytest_project_exists   s    r   c               C   s*   t j s&tt tsttt dks&td S )Nz<Project Object> NFB)proj_2r   r   r	   r
   r   r   r   r   r   test_project_not_exists   s    r   c              C   s6   t ttstd} tttttt| ks2td S )Nz<Project Object> surfmask_smpl2 `Surface masking samples 2` (private) 1 subject 1 MR experiment (owner: nosetests) (created on 2020-10-22 15:23:39.458) https://central.xnat.org/data/projects/surfmask_smpl2?format=html)r   r   r	   r
   listsortedr   )expected_outputr   r   r   test_info_project&   s    r   c               C   s*   t j r&tt tsttt dks&td S )Nz<Subject Object> BOA)subj_1r   r   r	   r
   r   r   r   r   r   test_subject_exists0   s    r   c               C   s*   t j s&tt tsttt dks&td S )Nz<Subject Object> BOA)subj_2r   r   r	   r
   r   r   r   r   r   test_subject_not_exists7   s    r   c              C   s6   t ttstd} tttttt| ks2td S )Nz<Subject Object> CENTRAL05_S01120 `001` (project: surfmask_smpl2) (Gender: U) 1 experiment https://central.xnat.org/data/projects/surfmask_smpl2/subjects/CENTRAL05_S01120?format=html)r   r   r	   r
   r   r   r   )r   r   r   r   test_info_subject>   s    r   c               C   s*   t j r&tt tsttt dks&td S )Nz<Experiment Object> GHJ)exp_1r   r   r	   r
   r   r   r   r   r   test_experiment_existsG   s    r   c               C   s*   t j s&tt tsttt dks&td S )Nz<Experiment Object> GHJ)exp_2r   r   r	   r
   r   r   r   r   r   test_experiment_not_existsN   s    r   c              C   s6   t ttstd} tttttt| ks2td S )Na   <Experiment Object> CENTRAL05_E02681 `001_obscured` (subject: CENTRAL05_S01120 `001`) (project: surfmask_smpl2) 4 scans 1 resource (created on 2020-10-22 15:24:30.139) https://central.xnat.org/data/projects/surfmask_smpl2/subjects/CENTRAL05_S01120/experiments/CENTRAL05_E02681?format=html)r   r   r	   r
   r   r   r   )r   r   r   r   test_info_experimentU   s    r   c               C   s*   t j r&tt tsttt dks&td S )Nz<Scan Object> JKL)scan_1r   r   r	   r
   r   r   r   r   r   test_scan_exists`   s    r    c               C   s*   t j s&tt tsttt dks&td S )Nz<Scan Object> JKL)scan_2r   r   r	   r
   r   r   r   r   r   test_scan_not_existsg   s    r"   c              C   s6   t ttstd} tttttt| ks2td S )Nz<Scan Object> 11 (`SPGR` 175 frames)  https://central.xnat.org/data/projects/surfmask_smpl2/subjects/CENTRAL05_S01120/experiments/CENTRAL05_E02681/scans/11?format=html)r   r   r	   r
   r   r   r   )r   r   r   r   test_info_scann   s    r#   c               C   s*   t j r&tt tsttt dks&td S )Nz<Resource Object> IOP)
resource_1r   r   r	   r
   r   r   r   r   r   test_resource_existsw   s    r%   c               C   s*   t j s&tt tsttt dks&td S )Nz<Resource Object> IOP)
resource_2r   r   r	   r
   r   r   r   r   r   test_resource_not_exists~   s    r'   c              C   s6   t ttstd} tttttt| ks2td S )NzI<Resource Object> 123361501 `obscure_algorithm_output` (66 files 2.06 GB))r   r$   r	   r
   r   r   r   )r   r   r   r   test_info_resource   s    r(   c              C   sh   t jjd} ddlm} | j}| j|}|j  |j s>t	|j
  |j  |j
  |j  sdt	d S )NZ
nosetests5r   )uuid1)centralselectprojectuuidr)   hexsubjectcreater   r
   delete)pr)   Zsidsr   r   r   test_create_delete_create   s    
r4   )/Zpyxnatr   os.pathpathop r   dirnameabspath__file__Z_modulepathjoinfpprintr*   r+   r,   r   r/   r   Z
experimentr   scanr   resourcer$   r   r   r   r!   r&   r   r   r   r   r   r   r   r   r   r    r"   r#   r%   r'   r(   r4   r   r   r   r   <module>   s@   










		