a Փ?g@sxddlZddlmmZddlZddlmZddl m Z ej ddZ ej ddZ ej dd Zd d Zd d ZdS)N) TestClient)appcCs0tt}|WdS1s"0YdS)N)rr)clientrM/home/cmiss/Jenkins/workspace/12-Labours-API/tests/test_api/test_irods_api.pyrs rcCs"dddd}|jd|d}|S)Nzdummy_email@gmail.comdummy_machine_iddummy_expiration_time)emailmachine expirationz /access/token)json)postr )r dummy_dataresponserrrtoken s rcCs$|jddd|did}|S)Nz/access/oneoff AuthorizationBearer access_token)headers)getr )rrrrrr one_off_tokens rc Csi}|jd|dd|did}|}|j}d}||k}|std|fd||fd tvsjt|rtt|nd t|t|d }d d |i} t t | d}}}|j} | }t |} d } | | k} | s|td| fd| | fdtvstt rtt ndd tvs.t|r8t|nd t| t|t| t| d}dd|i}t t |d} }} } } ddi}|jd|dd|did}|}|j}d}||k}|sBtd|fd||fd tvst|rt|nd t|t|d }d d |i} t t | d}}}|j} | }t |} d } | | k} | std| fd| | fdtvstt rtt ndd tvst|rt|nd t| t|t| t| d}dd|i}t t |d} }} } } ddi}|jd|dd|did}|}|j}d}||k}|std|fd||fd tvst|rt|nd t|t|d }d d |i} t t | d}}}|d}d}||k} | sLtd| fd||ft|t|d}dd|i}t t |d}} }ddi}|jd|dd|did}|}|j}d}||k}|s td|fd||fd tvst|rt|nd t|t|d }d d |i} t t | d}}}|d}d}||k} | svtd| fd||ft|t|d}dd|i}t t |d}} }dd i}|jd|dd|did}|}|j}d!}||k}|s4td|fd||fd tvst|rt|nd t|t|d }d d |i} t t | d}}}|d}d"}||k} | std| fd||ft|t|d}dd|i}t t |d}} }dS)#Nz /collectionrrr)r r==z3%(py2)s {%(py2)s = %(py0)s.status_code } == %(py5)srpy0py2py5assert %(py7)spy7)zb%(py7)s {%(py7)s = %(py0)s(%(py5)s {%(py5)s = %(py3)s {%(py3)s = %(py1)s.json }() }) } == %(py10)slen)rpy1py3rr Zpy10zassert %(py12)sZpy12pathz/dataset-217-version-2idetailzInvalid path format is usedz%(py1)s == %(py4)sr#py4assert %(py6)spy6z%/dataset-217-version-2/dummy_filename#Data not found in the provided pathz/dataset-12L_0-version-1Unable to access the data) r r status_code @pytest_ar_call_reprcompare @py_builtinslocals_should_repr_global_name _safereprAssertionError_format_explanationr")rrZpass_case_rootrresult @py_assert1 @py_assert4 @py_assert3 @py_format6 @py_format8 @py_assert2 @py_assert6Z @py_assert9Z @py_assert8Z @py_format11Z @py_format13Z pass_case_subZempty_string_path @py_assert0 @py_format5 @py_format7Z wrong_pathZno_access_caserrrtest_get_irods_collection!sZplrEc Csd}d}|d|d|d|d}|}|j}d}||k}|std|fd ||fd tvspt|rzt|nd t|t|d } d d | i} t t | d}}}|d} d}| |k} | std| fd| |ft| t|d} dd| i}t t |d} } }|d} d}| |k} | std| fd| |ft| t|d} dd| i}t t |d} } }d}d}|d|d|d|d}|}|j}d}||k}|sFtd|fd ||fd tvst|rt|nd t|t|d } d d | i} t t | d}}}|d} d}| |k} | std| fd| |ft| t|d} dd| i}t t |d} } }d}d}|d|d|d|d}|}|j}d}||k}|srtd|fd ||fd tvs4t|r>t|nd t|t|d } d d | i} t t | d}}}|d} d}| |k} | std| fd| |ft| t|d} dd| i}t t |d} } }d}d}|d|d|d|d}|}|j}d}||k}|std|fd ||fd tvs`t|rjt|nd t|t|d } d d | i} t t | d}}}dS)Npreviewz;dataset-217-version-2/derivative/scaffold_context_info.jsonz/data//z?token=rrrrrrrr descriptionzAnnotated brainstem scaffold for pig available for registration of segmented neural anatomical-functional mapping of neural circuits.r(r)r+r,headingzGeneric pig brainstem scaffoldz6dataset-217-version-2/derivative/scaffold_context_infor-r'r.z&dataset-12L_0-version-1/dummy_filenamer/r0Zpreloadi) rr r1r2r3r4r5r6r7r8r9)rrZACTIONZFILEPATHrr:r;r<r=r>r?rBr@rCrDZINVALID_FILEPATHZINVALID_ACTIONrrrtest_get_irods_data_fileUs@llllrJ)builtinsr4_pytest.assertion.rewrite assertionrewriter2pytestfastapi.testclientrapp.mainrfixturerrrrErJrrrrs"     4