+
    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t^ RIHt ^ RIHt ^ RIHtHtHt R R ltR R	 ltR
 R ltR R ltR R ltR R ltR# )    )annotationsN)Path)
ModuleType)AccountSnapshotHealthStatus
NamedLimitc                   V ^8  d   QhRR/# )   returnr    )formats   "i/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/tests/test_verify_claude_health.py__annotate__r      s      j     c            	        \        \        4      P                  4       P                  ^,          R,          R,          p V P                  q! 4       q"'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;r\        P                  P                  R	V 4      pRqTVJq'       g   \        P                  ! RV3RWE3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;rVP                   pRqVJq"'       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      R\        P                  ! V4      /,          pRRV/,          p	\        \        P                  ! V	4      4      hR;p;r(\        P                  P#                  V4      p
VP                   P%                  V
4       V
# )   scriptsverify_claude_health.pyAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}py0script_pathpy2py4Nverify_claude_healthspecpy3assert %(py5)spy5assert %(py7)spy7is notz%(py0)s is not %(py3)sz2%(py2)s
{%(py2)s = %(py0)s.loader
} is not %(py5)s)r   __file__resolveparentsexists@py_builtinslocals
@pytest_ar_should_repr_global_name	_safereprAssertionError_format_explanation	importlibutilspec_from_file_location_call_reprcompareloadermodule_from_specexec_module)r   @py_assert1@py_assert3@py_format5r   @py_assert2@py_format4@py_format6@py_assert4@py_format8modules              r   _load_moduler?      s   x.((*2215	AD]]K;;>>112H+VDt444t;;"d"d""""";""""""4""""4""";"""d""""""""^^,,T2FKKF#Mr   c                   V ^8  d   QhRR/# r	   r
   Noner   )r   s   "r   r   r      s     (+ (+TX (+r   c           	     *   \        \        4      P                  4       P                  ^,          R,          R,          pVP                  q"! 4       q3'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;r#\        R	4      p ! R
 R4      p ! R R4      pWen        Wun        \        R4      p ! R R4      p	Wn        \        R4      p
\         V
n        \"        V
n        V P%                  \&        P(                  R	V4       V P%                  \&        P(                  RV4       V P%                  \&        P(                  RV
4       \*        P,                  P/                  RV4      pRqVJq"'       g   \        P0                  ! RV3RW3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;r,VP2                  pRqVJq3'       g   \        P0                  ! 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      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;r?\*        P,                  P5                  V4      pVP2                  P7                  V4       VP                   q"\         J q3'       Eg   \        P0                  ! R!V3R"V\         34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#VP"                  q"\"        J q3'       Eg   \        P0                  ! R!V3R#V\"        34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      RR\
        P                  ! 4       9   g!   \        P                  ! \"        4      '       d   \        P                  ! \"        4      MR/,          pRRV/,          p\        \        P                  ! V4      4      hR;r#R# )$r   r   r   r   r   r   r   r   Naccount_registryc                  "    ] tR t^tR R ltRtR# )Ptest_module_import_does_not_require_unused_health_status_symbol.<locals>.Accountc                   V ^8  d   QhRR/# rA   r   )r   s   "r   r   ]test_module_import_does_not_require_unused_health_status_symbol.<locals>.Account.__annotate__        	 	T 	r   c                	    Wn         R # NargsselfrM   s   &*r   __init__Ytest_module_import_does_not_require_unused_health_status_symbol.<locals>.Account.__init__       Ir   rL   N__name__
__module____qualname____firstlineno__rP   __static_attributes__r   r   r   AccountrF          	 	r   rY   c                  "    ] tR t^"tR R ltRtR# )Stest_module_import_does_not_require_unused_health_status_symbol.<locals>.AccountRefc                   V ^8  d   QhRR/# rA   r   )r   s   "r   r   `test_module_import_does_not_require_unused_health_status_symbol.<locals>.AccountRef.__annotate__#   rI   r   c                	    Wn         R # rK   rL   rN   s   &*r   rP   \test_module_import_does_not_require_unused_health_status_symbol.<locals>.AccountRef.__init__#   rR   r   rL   NrS   r   r   r   
AccountRefr\   "   rZ   r   ra   claude_health_clientc                      ] tR t^+tR tRtR# )[test_module_import_does_not_require_unused_health_status_symbol.<locals>.ClaudeHealthClientc                	    \        R 4      h)z"fetch should not run during import)r-   )rO   rM   kwargss   &*,r   fetchatest_module_import_does_not_require_unused_health_status_symbol.<locals>.ClaudeHealthClient.fetch,   s     !EFFr   r   NrT   rU   rV   rW   rg   rX   r   r   r   ClaudeHealthClientrd   +   s    	Gr   rj   health_clientverify_claude_health_stubbedr   r   r   r   r   r   r>   r   zassert %(py6)spy6r   r    r"   r#   )is)z7%(py2)s
{%(py2)s = %(py0)s.AccountSnapshot
} is %(py4)s)z2%(py2)s
{%(py2)s = %(py0)s.NamedLimit
} is %(py4)s)r   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r   rY   ra   rj   r   r   setitemsysmodulesr/   r0   r1   r2   r3   r4   r5   )monkeypatchr   r6   r7   r8   rD   rY   ra   rb   rj   rk   r   r9   r:   r;   r<   r=   r>   @py_format7s   &                  r   ?test_module_import_does_not_require_unused_health_status_symbolrt      s_   x.((*2215	AD]]K;;!"45    '",%&<=G G /A+/M$3M!)M%79IJ%;=QR_mD>>112PR]^Dt444t;;"d"d""""";""""""4""""4""";"""d""""""""^^,,T2FKKF#!!4_44444!_444444644446444!444444_4444_44444444*
*****
******6****6*********
****
********r   c                    V ^8  d   QhRRRR/# r	   tmp_pathr   r
   rB   r   )r   s   "r   r   r   C   s     0 0t 0 0r   c                   \        4       p\        P                  ! 4       p\        P                  ! 4       pVP                  R .W#R7      p^qTV8H  qf'       g   \        P
                  ! RV3RWE3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;reVP                  qf! 4       p	RqV
8H  q'       g   \        P
                  ! RV3RW3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	;rRqP                  q! 4       qV
9   qU'       g   \        P
                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;r\        V 4      qSP                  q! 4       pVV9  q'       Eg   \        P
                  ! RV3RVV34      RR\        P                  ! 4       9   g!   \        P                  ! \        4      '       d   \        P                  ! \        4      MRRR\        P                  ! 4       9   g   \        P                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V
4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p
pRqP                  q! 4       qV
9  qU'       g   \        P
                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;rR# )r   stdoutstderrr   	exit_coder    r   r   Nrz   r   r   r   assert %(py9)spy9--account-homepy1r{   strrw   zassert %(py11)spy11z	~/.claude==z%(py0)s == %(py3)szG%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.getvalue
}()
} == %(py7)sinzG%(py1)s in %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.getvalue
}()
}not in)zi%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} not in %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s.getvalue
}()
}zK%(py1)s not in %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.getvalue
}()
})r?   ioStringIOmainr*   r2   r(   r)   r+   r,   r-   r.   getvaluer   )rw   r>   rz   r{   r|   r9   r6   r:   r;   r7   @py_assert6@py_assert5r=   @py_format10@py_assert0r<   @py_assert8@py_format12s   &                 r   (test_main_requires_explicit_account_homer   C   s   ^F[[]F[[]F34VSI>999??"?"""""""""""""6""""6"""?""""""""""""""0000000000000000000v0000v000000000000000x=11 11= 111111= 11111113111131111111x1111x111=1111111111111111 111111111/oo/o////////;///;//////f////f///o////////////r   c                    V ^8  d   QhRRRR/# rv   r   )r   s   "r   r   r   Q   s     9- 9-9- 
9-r   c                  a \        4       pVR ,          pVP                  4        / o ! V3R lR4      pV P                  VRV4       \        P                  ! 4       p\        P                  ! 4       pVP                  RR\        V4      .VVR7      p^ qV8H  q'       g   \        P                  ! R(V	3R)Wx3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;rVP                  q! 4       pR
qV8H  q'       g   \        P                  ! R(V3R*W3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;r\         P"                  ! VP                  4       4      p\%        V4      p. R+OqV8H  pV'       Eg   \        P                  ! R(V3R,W34      RR\        P                  ! 4       9   g!   \        P                  ! \$        4      '       d   \        P                  ! \$        4      MRRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR	\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;ppRR RR!RR!RR!RR!R^/pVV8H  q'       g   \        P                  ! R(V	3R)VV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;rR"VR#R$/pSV8H  q'       g   \        P                  ! R(V	3R)SV34      RR%\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MR%R	\        P                  ! V4      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;rR&pVP                  pV! 4       pVV9  q'       g   \        P                  ! R-V3R.VV34      R\        P                  ! V4      R	R'\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR'R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;ppR# )/CLAUDE_HOMEc                  .   < ] tR t^ZtRR V 3R llltRtR# )Ytest_main_emits_expected_schema_and_returns_zero_for_healthy_snapshot.<locals>.FakeClientc                    V ^8  d   QhRRRR/# r	   timeout_secsfloatr
   r   r   )r   s   "r   r   ftest_main_emits_expected_schema_and_returns_zero_for_healthy_snapshot.<locals>.FakeClient.__annotate__[   s     	 	u 	 	r   c                	   < VP                   SR &   VSR&   \        \        P                  ^^=RR\	        RR^RR4      \	        RR^=RR4      \	        R	R	^
R
R4      3RR7      # )account_homer   g   `A   aA	five_hourprimaryT	seven_day	secondaryburstg   !Aztoken=secret should never print)statusprimary_used_pctsecondary_used_pctprimary_reset_atsecondary_reset_atnamed_limitsdetail)r   r   r   OKr   )rO   accountr   seens   &&&r   rg   _test_main_emits_expected_schema_and_returns_zero_for_healthy_snapshot.<locals>.FakeClient.fetch[   sw    #*#7#7D #/D "#!##%!0#2{Ir?DQ{K_dSw_dK
 9 r   r   N      $@ri   )r   s   r   
FakeClientr   Z   s    	 	r   r   rj   r   r   ry   r   r|   r   r}   r   r   Nr{   r   r   r   r~   r   r   five_hour_availableseven_day_availablefive_hour_reset_validseven_day_reset_validnamed_limit_countlistr   payloadrm   assert %(py8)spy8okTr   r   r   r   secretrz   r   r   r   )r   r   r   r   r   r   )z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sr   r   )r?   mkdirsetattrr   r   r   r   r*   r2   r(   r)   r+   r,   r-   r.   r   jsonloadsr   )rr   rw   r>   r   r   rz   r{   r|   r9   r6   r:   r;   r7   r   r   r=   r   r   r<   rs   @py_format9r   r   s   &&                    @r   Etest_main_emits_expected_schema_and_returns_zero_for_healthy_snapshotr   Q   sA    ^Fm+L D $  4jA[[]F[[]F	!13|3DE  I >999??"?"""""""""""""6""""6"""?""""""""""""""jj*+G=        =     4   4           =             	$ttQ 7     7      7   7            #L.$GG4GGGGGG4GGGGGGG4GGGG4GGGGGGGGGGGG,6??,?,,8,,,,,,8,,,,8,,,,,,6,,,,6,,,?,,,,,,,,,,,,r   c                    V ^8  d   QhRRRR/# rv   r   )r   s   "r   r   r      s     42 4242 
42r   c                   \        4       pVR ,          pVP                  4         ! R R4      pV P                  VRV4       \        P                  ! 4       p\        P                  ! 4       pVP                  RR\        V4      .VVR7      p^qV8H  q'       g   \        P                  ! R&V	3R'Wx3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;rVP                  q! 4       pR
qV8H  q'       g   \        P                  ! R&V3R(W3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;r\         P"                  qP                  pV! 4       q! V4      pRRRRRRRRRRR^/pVV8H  pV'       Eg`   \        P                  ! R&V3R)VV34      RR\        P                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V	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      R\        P                  ! V4      /,          pR R!V/,          p\        \        P                  ! V4      4      hR;p	;p;p;p;ppR* EFv  pVP                  q! 4       pVV9  q'       Eg   \        P                  ! R+V	3R,VV34      RR"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R#\        P                  ! V4      /,          pR$R%V/,          p\        \        P                  ! V4      4      hR;p	;rVP                  q! 4       pVV9  q'       Eg   \        P                  ! R+V	3R,VV34      RR"\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MR"RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R#\        P                  ! V4      /,          pR$R%V/,          p\        \        P                  ! V4      4      hR;p	;rEKy  	  R# )-r   c                  &    ] tR t^tRR R lltRtR# )[test_main_returns_one_when_required_reset_is_missing_and_redacts_detail.<locals>.FakeClientc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   htest_main_returns_one_when_required_reset_is_missing_and_redacts_detail.<locals>.FakeClient.__annotate__   s     	 	u 	 	r   c                	v    \        \        P                  ^^=\        RR^RR4      \        RR^=RR4      3RR	7      # )
   r   r   NTr   r   r   zfemail=probe@example.com path=/tmp/private account_id=acct_123 authorization=Bearer abc payload={"a":1})r   r   r   r   r   )r   r   r   r   )rO   r   r   s   &&&r   rg   atest_main_returns_one_when_required_reset_is_missing_and_redacts_detail.<locals>.FakeClient.fetch   sG    "#!##%{Ir4F{K_dS
U r   r   Nr   ri   r   r   r   r   r      s    	 	r   r   rj   r   r   ry   r   r|   r   r}   r   r   Nr{   r   r   r   r~   r   r   r   r   Tr   r   Fr   r   r   rz   py12zassert %(py14)spy14	forbiddenrm   r   r   r   r   r   )z%(py9)s
{%(py9)s = %(py2)s
{%(py2)s = %(py0)s.loads
}(%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.getvalue
}()
})
} == %(py12)s)zprobe@example.comz/tmp/privateacct_123z
Bearer abcr   r   )zK%(py0)s not in %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.getvalue
}()
})r?   r   r   r   r   r   r   r*   r2   r(   r)   r+   r,   r-   r.   r   r   r   )rr   rw   r>   r   r   rz   r{   r|   r9   r6   r:   r;   r7   r   r   r=   r   r<   r   @py_assert11@py_assert10@py_format13@py_format15r   rs   r   s   &&                        r   Gtest_main_returns_one_when_required_reset_is_missing_and_redacts_detailr      s;    ^Fm+L    4jA[[]F[[]F	!13|3DE  I >999??"?"""""""""""""6""""6"""?"""""""""""""":: oo o' :'( $ttQ- ( -    ( -     4   4   :     f   f   o   '   (    -        	 !'1 11y 111111y 1111111y1111y11111111111111111 111111111 &1 11y 111111y 1111111y1111y11111111111111111 111111111r   c                   V ^8  d   QhRR/# rA   r   )r   s   "r   r   r      s     3 3d 3r   c                 "   \        4       p \        P                  ! 4       p\        P                  ! 4       pV P                  . ROVVR7      p^qCV8H  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      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;rTVP                  qU! 4       pRqV	8H  q'       g   \        P
                  ! RV
3RW3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;rRqP                  q! 4       qV	9   qD'       g   \        P
                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;rRqP                  q! 4       qV	9  qD'       g   \        P
                  ! RV3RW34      R\        P                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;p;p;rR	# )r   missing-homery   r   r|   r   r}   r   r   Nrz   r   r   r   r~   r   z(--account-home must point to a directoryr   r{   )r   r   r   r   r   r   r   r   r   r   )r?   r   r   r   r*   r2   r(   r)   r+   r,   r-   r.   r   )r>   rz   r{   r|   r9   r6   r:   r;   r7   r   r   r=   r   r   r<   s                  r   ,test_main_rejects_non_directory_account_homer      s-   ^F[[]F[[]FB  I >999??"?"""""""""""""6""""6"""?""""""""""""""5JJ9JJ9JJJJJJ5JJJ5JJJJJJJJJJJJJJJJ9JJJJJJJJJ22!22!222222>222>2222222222222222!222222222r   )
__future__r   builtinsr(   _pytest.assertion.rewrite	assertionrewriter*   importlib.utilr/   r   r   rp   pathlibr   typesr   rk   r   r   r   r?   rt   r   r   r   r   r   r   r   <module>r      sF    "     	  
   C C(+V09-x42n3r   