+
    5mj  c                  T   ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	t	^ RI
Ht ^ RIt]	P                  P                  ^ ]! ]! ]4      P#                  4       P$                  ^,          4      4       ^ RIt^ RItR R lt]P,                  R R l4       tR R	 ltR
 R ltR R ltR R ltR# )    )annotationsN)Pathc                    V ^8  d   QhRRRR/# )   base_dirr   returnNone )formats   "Y/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_cld.py__annotate__r      s      $ 4     c                    V R ,          pVP                  RRR7       VR,          P                  \        P                  ! RRR/RRR	R
.RRR^d/4      RR7       R# )%.local/state/overdeck/systray/runtimeTparentsexist_okzclaude_routing_rules.jsonprojectszync.isavidefaultrafafallback_chainroyfallback_triggerbroken_or_quota_exhaustedquota_exhausted_threshold_pctutf-8encodingN)mkdir
write_textjsondumps)r   tray_dirs   & r   write_rulesr%      sm    AAHNN4$N/++77

Y.6 5'"$?/	
  8 r   c               $    V ^8  d   QhRRRRRR/# )r   tmp_pathr   monkeypatchpytest.MonkeyPatchr   r	   )r
   s   "r   r   r   !   s"     	 	t 	*< 	 	r   c                \  a  VP                  \        P                  R V 3R l4       VP                  \        P                  RR 4       \	        S 4       R F1  pS R,          R,          V,          R,          P                  RR7       K3  	  S R,          R	,          P                  R
RR7       S # )homec                    < S # Nr	   )r'   s   r   <lambda>base_dir.<locals>.<lambda>"   s    Xr   in_containerc                     R # Tr	   r	   r   r   r.   r/   #   s    PTr   r   claude-accountsCLAUDE_HOMET)r   zclaude_health_cache.jsonz{}r   r   )r   r   r   )setattrcommand_routerr   remote_dispatchr%   r    r!   )r'   r(   slugs   f& r   r   r       s    ++V5EF66U&	;	;>O	ORV	VYf	fmm 	n 	
 ' 77:TT``aepw`xOr   c               $    V ^8  d   QhRRRRRR/# r   r   r   r(   r)   r   r   r	   )r
   s   "r   r   r   -   s$      !3	r   c                  a / oVP                  \        R R R l4       VP                  \        P                  RR 4       R V3R llpVP                  \        P                  RV4       \
        P                  ! \        4      ;_uu_ 4        \        P                  ! RR	.4       RRR4       SR
,          pRqCV8H  qU'       gy   \        P                  ! R!V3R"W434      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTSR,          pRR	.qCV8H  qU'       gy   \        P                  ! R!V3R"W434      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rTSR,          R,          pRpW,          p	Rp
W,          pRpW,          pRpW,          p\        V4      pVV8H  qU'       Egv   \        P                  ! R!V3R#VV34      R\        P                  ! V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      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;p;p;p;ppR#   + '       g   i     EL; i)$detect_project_nameNc                    R # r   r	   cwds   &r   r.   Btest_main_execs_claude_with_project_account_home.<locals>.<lambda>1       Yr   verify_env_supportc                    R # r2   r	   selfr+   s   &&r   r.   rA   2       _cr   c               (    V ^8  d   QhRRRRRRRR/# 	r   filestrargsz	list[str]envzdict[str, str]r   r   r	   )r
   s   "r   r   Ftest_main_execs_claude_with_project_account_home.<locals>.__annotate__4   s(      3 i n  r   c                8   < V SR &   VSR&   VSR&   \        ^ 4      h)rJ   rL   rM   
SystemExitrJ   rL   rM   	exec_calls   &&&r   fake_execvpeFtest_main_execs_claude_with_project_account_home.<locals>.fake_execvpe4   s+     	& 	&	%mr   execvpecldchatrJ   claudepy1py4assert %(py6)spy6rL   rM   CLAUDE_CONFIG_DIRr   r3   r   r4   py3rK   r   py9py12py15py18assert %(py20)spy20r-   ==z%(py1)s == %(py4)szd%(py1)s == %(py18)s
{%(py18)s = %(py3)s(((((%(py4)s / %(py6)s) / %(py9)s) / %(py12)s) / %(py15)s))
})r5   rW   r6   ClaudeAdapterospytestraisesrQ   main
@pytest_ar_call_reprcompare	_safereprAssertionError_format_explanationrK   @py_builtinslocals_should_repr_global_name)r   r(   rT   @py_assert0@py_assert3@py_assert2@py_format5@py_format7@py_assert5@py_assert7@py_assert8@py_assert10@py_assert11@py_assert13@py_assert14@py_assert16@py_assert17@py_format19@py_format21rS   s   &&                 @r   0test_main_execs_claude_with_project_account_homer   -   s    $&I24NO446JLcd  ))9lC	z	"	"%! 
# V(((((((((((((((((((((V26 22 222222222222 222222222U/0 ::=N:NQVNVYfVfCf5 0 5    0 5   0     C   C         :  =N  QV  Yf   5           
#	"	"s   N22O	c               $    V ^8  d   QhRRRRRR/# r:   r	   )r
   s   "r   r   r   F   s$      !3	r   c                v  a V R ,          R,          P                  RRR7       / oVP                  \        RRR l4       VP                  \        P                  RR	 4       R
 V3R llpVP                  \        P
                  RV4       \        P                  ! \        4      ;_uu_ 4        \        P                  ! R.4       RRR4       SR,          R,          pR pW,          pRpWV,          pRpWx,          p	Rp
W,          p\        V4      qV8H  q'       Egu   \        P                  ! R V3R!W<34      R\        P                  ! V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      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;p;p	;p
;rR#   + '       g   i     EL; i)"r   claude_default_slugzrafa
r   r   r<   Nc                    R # r>   r	   r?   s   &r   r.   Otest_main_prefers_systray_selected_default_over_project_route.<locals>.<lambda>M   rB   r   rC   c                    R # r2   r	   rE   s   &&r   r.   r   N   rG   r   c               (    V ^8  d   QhRRRRRRRR/# rI   r	   )r
   s   "r   r   Stest_main_prefers_systray_selected_default_over_project_route.<locals>.__annotate__P   s(      3 i n  r   c                $   < VSR &   \        ^ 4      h)rM   rP   rR   s   &&&r   rT   Stest_main_prefers_systray_selected_default_over_project_route.<locals>.fake_execvpeP   s    	%mr   rV   rW   rM   r^   r3   r   r4   rZ   r_   rK   r[   r   r]   r`   ra   rb   rc   rd   re   r-   rf   ri   )r!   r5   rW   r6   rj   rk   rl   rm   rQ   rn   rK   ro   rp   rq   rt   ru   rv   rr   rs   )r   r(   rT   rw   r|   r}   r~   r   r   r   r   r   r   ry   r   r   rS   s   &&              @r   =test_main_prefers_systray_selected_default_over_project_router   F   so    77:OO[[7 \  $&I24NO446JLcd  ))9lC	z	"	"% 
# U/0 ::=N:NQWNWZgWgCg5  5    0   0     C   C         :  =N  QW  Zg   5           
#	"	"s   -J''J8	c               $    V ^8  d   QhRRRRRR/# r:   r	   )r
   s   "r   r   r   ^   s$      !3	r   c                  a V R ,          R,          R,          R,          P                  RRR7       / oR!R R llpVP                  \        R	V4       VP                  \        P                  R
R 4       R V3R llpVP                  \        P
                  RV4       \        P                  ! \        4      ;_uu_ 4        \        P                  ! . R"O4       RRR4       SR,          pRR.qTV8H  qf'       gy   \        P                  ! R#V3R$WE34      R\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;reSR,          R,          pR p	W	,          p
RpW,          pRpW,          pRpW,          p\        V4      pVV8H  qf'       Egv   \        P                  ! R#V3R%VV34      R\        P                  ! V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      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;p;p;p;ppR#   + '       g   i     EL; i)&r   r3   r   r4   Tr   Nc                    V ^8  d   QhRRRR/# )r   r@   zPath | Noner   rK   r	   )r
   s   "r   r   Ftest_main_execs_explicit_claude_account_override.<locals>.__annotate__f   s     M Mk MS Mr   c                    \        R 4      h)z,routing must not run when --account is given)rr   r?   s   &r   fail_detect_project_nameRtest_main_execs_explicit_claude_account_override.<locals>.fail_detect_project_namef   s    KLLr   r<   rC   c                    R # r2   r	   rE   s   &&r   r.   Btest_main_execs_explicit_claude_account_override.<locals>.<lambda>j   rG   r   c               (    V ^8  d   QhRRRRRRRR/# rI   r	   )r
   s   "r   r   r   l   s(      3 i n  r   c                .   < VSR &   VSR&   \        ^ 4      h)rL   rM   rP   rR   s   &&&r   rT   Ftest_main_execs_explicit_claude_account_override.<locals>.fake_execvpel   s!     	&	%mr   rV   --printrL   rY   rZ   r[   r\   r]   rM   r^   r_   rK   r   r`   ra   rb   rc   rd   re   r-   )rW   z	--accountr   r   rf   rh   ri   )r    r5   rW   r6   rj   rk   rl   rm   rQ   rn   ro   rp   rq   rr   rs   rK   rt   ru   rv   )r   r(   r   rT   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   rS   s   &&                  @r   0test_main_execs_explicit_claude_account_overrider   ^   s    77:KKeSVccjjt k  $&IM 24LM446JLcd 
 ))9lC	z	"	"78 
# V59 55 555555555555 555555555U/0 ::=N:NQVNVYfVfCf5 0 5    0 5   0     C   C         :  =N  QV  Yf   5          	 
#	"	"s    MM$	c               $    V ^8  d   QhRRRRRR/# r:   r	   )r
   s   "r   r   r   |   s$         !3 	 r   c                  a R oR V3R llpVP                  \        P                  RV4       \        P                  ! . RO4      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	;rTR pSVJ qU'       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	;rTR	# )Fc               (    V ^8  d   QhRRRRRRRR/# rI   r	   )r
   s   "r   r   Gtest_main_rejects_unknown_claude_account_override.<locals>.__annotate__   s(      3 i n  r   c                   < R oR# )TNr	   )rJ   rL   rM   exec_calleds   &&&r   rT   Gtest_main_rejects_unknown_claude_account_override.<locals>.fake_execvpe   s    r   rV   py0	exit_coder_   zassert %(py5)spy5Nr   )rW   z--account=ghostrX   rf   )z%(py0)s == %(py3)s)is)z%(py0)s is %(py3)s)r5   r6   rk   rW   rn   ro   rp   rt   ru   rv   rq   rr   rs   )	r   r(   rT   r   ry   @py_assert1@py_format4@py_format6r   s	   &&      @r   1test_main_rejects_unknown_claude_account_overrider   |   s     K  ))9lC;<I>999;%;%;;%r   )
__future__r   builtinsrt   _pytest.assertion.rewrite	assertionrewritero   r"   syspathlibr   rl   pathinsertrK   __file__resolver   rW   r6   r%   fixturer   r   r   r   r   r	   r   r   <module>r      s~    "    
   3tH~--/77:; < 
 " 	 	20< r   