+
    5mj  c                  $   ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t	^ RI
t
^ RIHt ]
P                  P                  ^ ]! ]! ]4      P#                  4       P$                  ^,          4      4       ^ RIHtHtHtHtHt ^ RIHt R tR tR tR	 tR
 tR# )    )annotationsN)Path)AccountSnapshotExtraUsageSummaryHealthStatus
NamedLimitSpendSummary)HealthSnapshotStorec                f  aa V R ,          pVP                  RRR7       \        V^<R7      pR\        \        P                  ^^4      R\        \        P
                  RR4      /p/ o\        P                  oVV3R lpVP                  \        R	V4       VP                  V4       \        P                  ! VP                  RR7      4      pRR
RR^R^RRRRRRRRR. RRRR/
RR
RRRRRRRRRRRRRR. RRRR/
/qvV8H  q'       g   \        P                  ! R&V3R'Wg34      RR\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MRR\        P$                  ! V4      /,          p	RRV	/,          p
\'        \        P(                  ! V
4      4      hR;rSR,          pRqV8H  qw'       gy   \        P                  ! R&V3R(W34      R\        P$                  ! V4      R\        P$                  ! V4      /,          pRRV/,          p\'        \        P(                  ! V4      4      hR;p;r|\        P                  pSR ,          q! V4      qV8H  pV'       Eg3   \        P                  ! R&V3R)W34      RR!\        P                   ! 4       9   g!   \        P"                  ! \        4      '       d   \        P$                  ! \        4      MR!R"\        P$                  ! V4      R\        P$                  ! V4      R\        P$                  ! V4      R#R\        P                   ! 4       9   g   \        P"                  ! V4      '       d   \        P$                  ! V4      MR/,          pR$R%V/,          p\'        \        P(                  ! V4      4      hR;p;p;ppR# )*health_cache.jsonz{"existing": true}utf-8encodingstale_after_srafaroyNc                z   < \        V4      P                  R R7      SR&   V P                  R R7      SR&   S! W4      # )r   r   target_before_replacetemp_payload)r   	read_text)selftargetcapturedreal_replaces   &&b/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_health_store.pyfake_replaceCtest_write_is_atomic_and_serializes_snapshots.<locals>.fake_replace   s@    ,0L,B,BG,B,T()#'>>7>#C D))    replacestatusokprimary_used_pctsecondary_used_pctprimary_reset_atsecondary_reset_at
checked_atdetailnamed_limitsextra_usagespendbrokenpy0datapy3assert %(py5)spy5r   py1py4zassert %(py6)spy6r   jsonpy2py8zassert %(py10)spy10==z%(py0)s == %(py3)s)z%(py1)s == %(py4)s)zK%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.loads
}(%(py4)s)
} == %(py8)s)
write_textr	   r   r   OKBROKENr   r   setattrwriter4   loadsr   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)tmp_pathmonkeypatch
cache_pathstore	snapshotsr   r-   @py_assert2@py_assert1@py_format4@py_format6@py_assert0@py_assert3@py_format5@py_format7@py_assert5@py_assert7@py_format9@py_format11r   r   s   &&                 @@r   -test_write_is_atomic_and_serializes_snapshotsrZ      s   //J.A
"=ER8|22D$?I H<<L*
 i6	KK	::j**G*<=Dd " $$dB4T
 	h $ $$dB4T
     2 34  2 3 2 34  2 34  2 3      2 3 4 +,D0DD0DDDDDD,DDD,DDD0DDDDDDDDD::7h~.7:./7477777/777777477774777:777.777/777777477774777777777r   c                   V R ,          pVP                  \        P                  ! RRRR^R^/RRRR^R^/RRRRR	RR
//4      RR7       \        V^<R7      P	                  4       pR\        \        P                  ^^4      R\        \        P                  R
R
4      /q2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR
;rCR
# )r   r   r    r!   r"   r#   z
bad-statusmissingzbad-pct13Nr   r   r   r,   rM   r.   r/   r0   r8   r:   )r;   r4   dumpsr	   readr   r   r<   rA   rB   rC   rD   rE   rF   rG   rH   )rI   rK   rM   rN   rO   rP   rQ   s   &      r   5test_read_skips_bad_entries_and_keeps_valid_snapshotsr`   G   s\   //J

d&("
 i&(!
 d&($	
& )  . $JbAFFHI 	R8?<??D$?      9     9   9           r   c                N	   V R ,          pVP                  \        P                  ! RRRR^R^//4      RR7       \        P                  ! VR4       \        V^<R7      pVP                  R	R
 4       VP                  qD! 4       pRqeV8H  qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;rvVP                   qD! 4       pR\#        \$        P&                  ^^4      /qeV8H  qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;rvVP                  R	R 4       VP                  qD! 4       pRqeV8H  qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;rvVP                   qD! 4       pRqeVJ qw'       g   \        P                  ! RV3RWV34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;p;rvR# )r   r   r    r!   r"   r#   r   r   r   zhealth_store.time.timec                     R # )g     @ rc   r   r   <lambda>=test_read_fresh_respects_staleness_boundary.<locals>.<lambda>x       &r   g      N@r,   rL   r5   r2   py7assert %(py9)spy9Nc                     R # )gfffff@rc   rc   r   r   rd   re      rf   r   gN@)     @@rk   r8   )zJ%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.age_seconds
}()
} == %(py7)s)zI%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_fresh
}()
} == %(py7)siszI%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read_fresh
}()
} is %(py7)s)r;   r4   r^   osutimer	   r>   age_secondsrA   rB   rC   rD   rE   rF   rG   rH   
read_freshr   r   r<   )
rI   rJ   rK   rL   rO   rS   @py_assert6rV   @py_format8@py_format10s
   &&        r   +test_read_fresh_respects_staleness_boundaryrv   h   s/   //J

d&("	
    HHZ)*
"=E0.A&&$&$&&&&&&&&&&&5&&&&5&&&&&&&&&$&&&&&&&&  R8"  "         5   5          "         0.A33"33"333333333333533335333333333"333333333%%%%%%%%%%%%%%5%%%%5%%%%%%%%%%%%%%%%%r   c                2   \        V R ,          ^<R7      pVP                  q"! 4       pRqCVJ qU'       g   \        P                  ! R
V3RW434      RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR;p;p;rTVP                  q"! 4       pRqCVJ qU'       g   \        P                  ! R
V3RW434      RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR;p;p;rTR# )zmissing.jsonr   Nr,   rL   r5   r2   rg   rh   ri   rl   )zJ%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.age_seconds
}()
} is %(py7)srn   )r	   rq   rA   rB   rC   rD   rE   rF   rG   rH   rr   )rI   rL   rO   rS   rs   rV   rt   ru   s   &       r   .test_age_seconds_returns_none_for_missing_filerx      s)   > 9LE&&$&$&&&&&&&&&&&5&&&&5&&&&&&&&&$&&&&&&&&%%%%%%%%%%%%%%5%%%%5%%%%%%%%%%%%%%%%%r   c           "        V R ,          pVP                  \        P                  ! RRRR^R^/RRRR^R^RRR	R
RRRRRRRRRR^RRRR/RRRRRRRRRR/.RRRRR R!R"R#R$/R%R&R'RR(R)R*R#R+/R,R//4      R-R.7       \        V^<R/7      pVP	                  4       pR\        \        P                  ^^4      R\        \        P                  ^^RR
RR\        RR^RR4      3\        RR R"R$R07      \        R'R(R*R+R17      R27
      /qCV8H  qU'       g   \        P                  ! R>V3R?W434      R3R4\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR4R5\        P                   ! V4      /,          pR6R7V/,          p\#        \        P$                  ! V4      4      hR;rTVP'                  V4       VP                  qU! 4       qV8H  q'       Eg   \        P                  ! R>V	3R@W34      R3R8\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR8R9\        P                   ! V4      R:\        P                   ! V4      R;R4\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                   ! V4      MR4/,          p
R<R=V
/,          p\#        \        P$                  ! V4      4      hR;p;rR# )Ar   legacyr    r!   r"   r#   extendedr$   g   TAr%   g   tAr&   g  ^TAr'   zlimits unavailabler(   kind	five_hourgroupprimarypercent	resets_atactiveTignoredotherNbadr)   usedg      @limitg      $@unithoursdisplayz3 / 10 hoursr*   amountg      )@g      I@currencyUSDz$12.50 / $50unknownr   r   r   )r   r   r   r   )r   r   r   r   )
r    r"   r#   r$   r%   r&   r'   r(   r)   r*   r,   rM   r.   r/   r0   rL   r5   r2   r3   zassert %(py8)sr6   r8   r:   )zC%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.read
}()
} == %(py6)s)r;   r4   r^   r	   r_   r   r   r<   r   r   r   rA   rB   rC   rD   rE   rF   rG   rH   r?   )rI   rK   rL   rM   rN   rO   rP   rQ   rS   rV   rU   rX   s   &           r   5test_read_old_entries_and_round_trip_extended_entriesr      s   //J

d&(!
 d&("&(/ /2""K#Y%r'$d #I#W%t'$e%  "!>	$  $"E!>	 yI%,.	
^ a  1f  
"=E

I 	/,//1a8O??!,.&';	2M *&	 &	#
     4 59  4 5 4 59  4 59  4 5      4 5 8 
KK	::$:<$9$$$$$<$$$$$$5$$$$5$$$:$$$<$$$$$$9$$$$9$$$$$$$$r   ) 
__future__r   builtinsrC   _pytest.assertion.rewrite	assertionrewriterA   r4   ro   syspathlibr   pathinsertstr__file__resolveparentshealth_clientr   r   r   r   r   health_storer	   rZ   r`   rv   rx   r   rc   r   r   <module>r      sr    "    	 
  3tH~--/77:; <  -08fB&:&V%r   