o ËjÞhæã@sˆddlZddlmmZddlZddlmZejdd„ƒZ dd„Z dd„Z d d „Z d d „Z d d„Zdd„Zdd„Zdd„Zdd„ZdS)éN)ÚappcCsdtjd<t ¡S)NTÚTESTING)rÚconfigÚ test_client©rrú=/home/cmiss/Jenkins/workspace/SPARC-API-DEV/tests/test_pmr.pyÚclients rcCó˜| d¡}|j}d}||k}|sDt d|fd||f¡dt ¡vs%t |¡r*t |¡ndt |¡t |¡dœ}dd|i}tt  |¡ƒ‚d}}}dS) Nú /pmr_fileé•©ú==©z3%(py2)s {%(py2)s = %(py0)s.status_code } == %(py5)sÚr©Úpy0Úpy2Úpy5úassert %(py7)sÚpy7© ÚgetÚ status_codeÚ @pytest_arÚ_call_reprcompareÚ @py_builtinsÚlocalsÚ_should_repr_global_nameÚ _safereprÚAssertionErrorÚ_format_explanation©rrÚ @py_assert1Ú @py_assert4Ú @py_assert3Ú @py_format6Ú @py_format8rrrÚ test_pmr_file ó Žr'cCóœ|jdid}|j}d}||k}|sFt d|fd||f¡dt ¡vs't |¡r,t |¡ndt |¡t |¡dœ}dd |i}tt  |¡ƒ‚d}}}dS) Nr ©Újsonér rrrrr© Úpostrrrrrrrrr r!rrrÚtest_pmr_file_empty_postóŽr/cCó |jdddid}|j}d}||k}|sHt d|fd||f¡dt ¡vs)t |¡r.t |¡ndt |¡t |¡d œ}d d |i}tt  |¡ƒ‚d}}}dS) Nr Úpathzqworkspace/486/rawfile/55879cbc485e2d4c41f3dc6d60424b849f94c4ee/HumanSAN_Fabbri_Fantini_Wilders_Severi_2017.cellmlr*éÈr rrrrrr-r!rrrÚtest_pmr_file_valid_pathóŽr4cCr1) Nr r2Z invalid_pathr*r,r rrrrrr-r!rrrÚtest_pmr_file_invalid_pathr5r6cCr ) Nú/pmr_latest_exposurer r rrrrrrr!rrrÚ test_pmr_latest_exposure_no_postr(r8cCr)) Nr7r*r,r rrrrrr-r!rrrÚ#test_pmr_latest_exposure_empty_post$r0r9c Có|jdddid}|j}d}||k}|sHt d|fd||f¡dt ¡vs)t |¡r.t |¡ndt |¡t |¡d œ}d d |i}tt  |¡ƒ‚d}}}|  ¡}|d }d }||k} | st d| fd||f¡t |¡t |¡dœ} dd| i} tt  | ¡ƒ‚d}} }dS)Nr7Ú workspace_urlz0https://models.physiomeproject.org/workspace/486r*r3r rrrrrÚurlz(https://models.physiomeproject.org/e/611©z%(py1)s == %(py4)s©Úpy1Úpy4úassert %(py6)sÚpy6© r.rrrrrrrrr Úget_json© rrr"r#r$r%r&ÚdataÚ @py_assert0Ú @py_assert2Ú @py_format5Ú @py_format7rrrÚ7test_pmr_latest_exposure_workspace_with_latest_exposure)óŠnrKc Cr:)Nr7r;z0https://models.physiomeproject.org/workspace/698r*r3r rrrrrr<Úr=r>rArBrCrErrrÚ:test_pmr_latest_exposure_workspace_without_latest_exposure0rLrNcCr1) Nr7r;zhttps://some.url.com/r*r,r rrrrrr-r!rrrÚ=test_pmr_latest_exposure_workspace_with_invalid_workspace_url7r5rO)ÚbuiltinsrÚ_pytest.assertion.rewriteÚ assertionÚrewriterÚpytestrÚfixturerr'r/r4r6r8r9rKrNrOrrrrÚs"