a Eg@sddlZddlmmZddlZddlZddlmZej ddZ ddZ ddZ d d Z d d Zd dZddZddZddZddZddZddZddZddZdd ZdS)!N)appcCsdtjd<tS)NTTESTING)rconfig test_clientrrr5r'r*r,r r rrrrr-r2rrr0test_osparc_check_simulation_no_solver_name_dataPs rBcCsdddid}|jd|d}|j}d}||k}|std|fd ||fd tvs\t|rft|nd t|t|d }d d |i}tt |d}}}dS)Nr?r9r6rAr'r*r,r r rrrrr-r2rrr3test_osparc_check_simulation_no_solver_version_data[s rCcCsi}|jd|d}|j}d}||k}|std|fd||fdtvsRt|r\t|ndt|t|d}dd |i}tt |d}}}dSr0r-r2rrr$test_osparc_check_simulation_no_datafsrDc CsHdddddgdddd d d }d gd gddd}|jd|d}|j}d}||k}|std|fd||fdtvst|rt|ndt|t|d}dd|i}tt |d}}}t |j } | d} } d}| |u} | sFtd| fd| |ft| t|d} dd| i}tt |d} } }d } | | k}|std|fd | | fdtvst| rt| ndt| d!}d"d#|i}tt |d}} | d$}} d}| |u} | s6td| fd| |ft| t|d} dd| i}tt |d} } }|jd%|d}|j}d}||k}|std|fd||fdtvst|rt|ndt|t|d}dd|i}tt |d}}}t |j } | d} } d}| |u} | sRtd| fd| |ft| t|d} dd| i}tt |d} } }d } | | k}|std|fd | | fdtvst| rt| ndt| d!}d"d#|i}tt |d}} | d&r@t j}d'}|| |d(}t j}d'}|||d(}||k}|s td|fd)||fd*tvsPtt rZtt nd*t|d+tvs~t| rt| nd+t|t|d*tvstt rtt nd*t|d,tvst|rt|nd,t|t|d- }d.d/|i}tt |d}}}}}}}qDqBdS)0N[https://models.physiomeproject.org/e/611/HumanSAN_Fabbri_Fantini_Wilders_Severi_2017.cellml~jth?MbP?z Ending pointzPoint interval Membrane/V simulationoutput model_url json_configr6r7r8opencorr5ok)grGgMb`?rF)g:GgkGgGgPZG)zenvironment/timerI)statusresultsr r*r r rrrrrSis notz%(py1)s is not %(py4)spy1py4assert %(py6)spy6z%(py0)s == %(py3)srpy3assert %(py5)srr3r'rTT sort_keysz%(py7)s {%(py7)s = %(py2)s {%(py2)s = %(py0)s.dumps }(%(py3)s, sort_keys=%(py5)s) } == %(py16)s {%(py16)s = %(py11)s {%(py11)s = %(py9)s.dumps }(%(py12)s, sort_keys=%(py14)s) }r+ json_datares rrr`rrpy9py11Zpy12Zpy14Zpy16assert %(py18)spy18r.rrrrrrrrrr+loadsr3rdumpsrr3rfrr!r"r#r$r%rerS @py_assert0 @py_assert2 @py_format5 @py_format7 @py_format4Zcheck_simulation_data @py_assert6 @py_assert10Z @py_assert13Z @py_assert15 @py_assert8Z @py_format17Z @py_format19rrr!test_osparc_successful_simulationms>  r~r r~ Urxc Csdddddgdddd d d }d d d}|jd|d}|j}d}||k}|std|fd||fdtvs|t|rt|ndt|t|d}dd|i}tt |d}}}t |j } | d} } d}| |u} | s8td| fd| |ft| t|d} dd| i}tt |d} } }d} | | k}|std|fd| | fdtvst| rt| ndt| d }d!d"|i}tt |d}} | d#}} d}| |u} | s(td| fd| |ft| t|d} dd| i}tt |d} } }|jd$|d}|j}d}||k}|std|fd||fdtvst|rt|ndt|t|d}dd|i}tt |d}}}t |j } | d} } d}| |u} | sDtd| fd| |ft| t|d} dd| i}tt |d} } }| d krt j}d%}|| |d&}t j}d%}|||d&}||k}|std|fd'||fd(tvstt rtt nd(t|d)tvst| rt| nd)t|t|d(tvs&tt r0tt nd(t|d*tvsTt|r^t|nd*t|t|d+ }d,d-|i}tt |d}}}}}}}qq4dS).NrEg@g?rHrIrJrMr6r7r8rPnokzthe simulation failed)rS descriptionr r*rUr r rrrrrSrVrXrYr\r]rRr^r_rarr3r'Trbrdr+rerfrgrjrkrlrorrrtest_osparc_failing_simulations8  r~r r Ur{)builtinsr_pytest.assertion.rewrite assertionrewriterr+pytestrfixturerr&r(r/r1r4r;r<r=r@rBrCrDrxr{rrrrs$"       )