+
    5mj?                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ^ RI	t	^ RI
t
^ RIt]
P                  P                  ^ ]! ]! ]4      P!                  4       P"                  ^,          4      4       ^ RI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 R l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 R lt ]!R 8X  d   ]"! ] ! 4       4      hR# )!zN:"
SYSTRAY_CODEX_SWITCHER_SHIM_ACTIVE=1 exec "${PYTHON:-python3}" "$0" "$@"
":)annotationsN)Pathc                    V ^8  d   QhRRRR/#    tmp_pathr   returnNone )formats   "k/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/tests/test_systray_codex_switcher.py__annotate__r      s      T d     c                    V R ,          p\         P                  ! V0 RmRR7       \        P                  ! VP	                  RR7      4      R/ RRR. RR	R
^dR/ /8X  g   Q hR# )routing_rules.jsonroyknown_slugsdefault_slugutf-8encodingprojectsdefaultfallback_chainfallback_triggerbroken_or_quota_exhaustedquota_exhausted_threshold_pctaccount_capsN>   avir   rafasystray_codex_switcherseed_routing_rulesjsonloads	read_textr   
rules_paths   & r   6test_seed_routing_rules_derives_defaults_from_registryr)      st    00J--* ::j**G*<=B5"7'B   r   c                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   (   s     N N$ N4 Nr   c                    V R ,          pVP                  RRR7       \        P                  ! V0 RmRR7       VP                  RR7      R8X  g   Q hR# )r   z{"default":"custom"}
r   r   r   r   N>   r   r   r    )
write_textr"   r#   r&   r'   s   & r   +test_seed_routing_rules_keeps_existing_filer-   (   sV    00J2WE-- 6U 15MMMMr   c                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   3   s     	R 	RD 	RT 	Rr   c                    V R ,          p\         P                  ! VRR0RR7       \        P                  ! VP	                  RR7      4      R,          R8X  g   Q hR# )	r   r   r   ghostr   r   r   r   Nr!   r'   s   & r   5test_seed_routing_rules_falls_back_to_registered_slugr1   3   sT    00J--EN ::j**G*<=iHEQQQr   c                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   ?   s     # #4 #D #r   c                P   V R ,          p\         P                  ! \        P                  4      ;_uu_ 4       p\        P                  ! V\        4       R7       RRR4       R\        XP                  4      9   g   Q hVP                  4       '       d   Q hR#   + '       g   i     LF; i)r   )r   Nzsetup required)	pytestraisesr"   RoutingRulesSetupRequiredErrorr#   setstrvalueexists)r   r(   excs   &  r   4test_seed_routing_rules_requires_registered_accountsr<   ?   sx    00J	-LL	M	MQT11*#%P 
N s399~---  """""	 
N	Ms   !BB%	c                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   I   s      d t r   c                8   V R ,          p\         P                  ! V4      p \        P                  ! \        4      ;_uu_ 4        \         P                  ! V4       RRR4       VP                  4        R#   + '       g   i     L"; i  TP                  4        i ; iz	tray.lockN)r"   acquire_single_instance_lockr4   r5   RuntimeErrorclose)r   	lock_pathfirsts   &  r   7test_acquire_single_instance_lock_rejects_second_holderrE   I   sc    ;&I"??	JE]]<(("??	J ) 	 )( 	s#   "B A4B 4B	?B Bc                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   T   s      t PT r   c                    V R ,          p\         P                  ! V4      pVP                  4        \         P                  ! V4      pVP                  4        R# r?   )r"   r@   rB   )r   rC   rD   seconds   &   r   8test_acquire_single_instance_lock_reusable_after_releaserI   T   s>    ;&I"??	JE	KKM#@@KF
LLNr   c               (    V ^8  d   QhRRRRRRRR/# )	r   monkeypatchpytest.MonkeyPatchr   r   capsyszpytest.CaptureFixture[str]r   r	   r
   )r   s   "r   r   r   ^   s,      #/3=W	r   c                   V P                  \        R V4       \        P                  ! VR,          4      p \        P                  ! \
        4      ;_uu_ 4       p\        P                  ! 4        RRR4       XP                  P                  ^8X  g   Q hRVP                  4       P                  9   g   Q h VP                  4        R#   + '       g   i     La; i  TP                  4        i ; i)TRAY_DIRzcodex-account-switcher.lockNzsystray-ai is already running)setattrr"   r@   r4   r5   
SystemExitmainr9   code
readouterrerrrB   )rK   r   rM   held_handler;   s   &&&  r   $test_main_exits_when_already_runningrW   ^   s     .
HE(EE00K]]:&&#"'') 'yy~~""".&2C2C2E2I2IIII '&
 	s$   "C C.AC C	C C,c               $    V ^8  d   QhRRRRRR/# r   rK   rL   r   r   r   r	   r
   )r   s   "r   r   r   n   s)     ^+ ^+#^+/3^+	^+r   c                  aaaaaaaaaaaaaa . oV P                  R R4       RBR V3R lllp ! V3R lR4      p ! V3R lR4      pV! R	4      o\        4       o\        4       o\        4       o\        4       o\        4       o\        4       o\        4       oV! 4       o\        4       o\        4       o ! V3R
 lR4      p ! V3R lR4      pV P                  \        RV4       V P                  \        RV4       V! R4      oV! R4      oVVVV3R lpVV3R lpV P                  \        RV4       V P                  \        RV4       V P                  \        RVV3R l4       V P                  \        RVV3R l4       V P                  \        RVV3R l4       V P                  \        RVV3R l4       V P                  \        RVV3R l4       V P                  \        R VV3R! l4       VV3R" lp	V P                  \        R#V	4       V P                  \        R$VV3R% l4        ! V3R& lR'4      p
V P                  \        R(V
4       V P                  \        R)VV3R* l4       V P                  \        R+V4       \        P                  ! 4        R \        P
                  P                  9  g   Q hSR,,          R-R.\        P                  P                  /3RCR/R0VR1,          0 RDmR23R-R.\        P                  P                  /3RER/R0VR3,          0 RDmR23R-R.\        P                  P                  /3R4S3.
8X  g   Q hR5S9   g   Q hR6S9   g   Q hR7SS3S9   g   Q hR8S3S9   g   Q hR9S3S9   g   Q hR:S3S9   g   Q hR;S9   g   Q hR4S3S9   g   Q hR<S9   g   Q hR=\        P                  P                  SSS3S9   g   Q hR=\        P                  P                  SSS3S9   g   Q hR=\        P                  P                  SSS3S9   g   Q h\        R> S 4       4      p\        V^,          4      ^8X  g   Q hR?SSSSSSS3S9   g   Q hSRFR R@RA.8X  g   Q hR# )G
CODEX_HOMEz//home/user/.codex-tray/accounts/rafa/CODEX_HOMENc                    V ^8  d   QhRRRR/# )r   pathr   r   r	   r
   )r   s   "r   r   Jtest_main_wires_registry_health_client_and_indicator.<locals>.__annotate__t   s     A A Ad Ar   c                0   < SP                  R WV34       R# )seedNappendr]   r   r   eventss   &&&r   	fake_seedGtest_main_wires_registry_health_client_and_indicator.<locals>.fake_seedt   s    vt,?@r   c                  N   < ] tR t^wtR R ltR V 3R lltV 3R ltR R ltRtR	# )
zJtest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistryc                    V ^8  d   QhRRRR/# )r   namer8   r   r	   r
   )r   s   "r   r   Wtest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistry.__annotate__x   s     	 	 	 	r   c                	    Wn         R # Nri   )selfri   s   &&r   __init__Stest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistry.__init__x   s    Ir   c                   V ^8  d   QhRR/# r   r   r	   r
   )r   s   "r   r   rj   {   s     	9 	9D 	9r   c                	B   < SP                  R V P                  34       R# )migrate_legacyN)rb   ri   rn   rd   s   &r   rt   Ytest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistry.migrate_legacy{   s    MM+TYY78r   c                	   < SP                  R 4       \        RRRR/4      ! 4       \        RRRR/4      ! 4       \        RRRR/4      ! 4       .# )listAccountslugr   r    r   r
   rb   typeru   s   &r   rx   Otest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistry.list~   sS    MM&!YVUO46YVV$457YVUO46 r   c                   V ^8  d   QhRR/# r   r   r8   r
   )r   s   "r   r   rj           	 	# 	r   c                	    R # )r   r
   rn   s   &r   r   Wtest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistry.default_slug       r   rm   N)	__name__
__module____qualname____firstlineno__ro   rt   rx   r   __static_attributes__rd   s   r   FakeRegistryJtest_main_wires_registry_health_client_and_indicator.<locals>.FakeRegistryw   s!    		9 	9		 	r   r   c                  *   < ] tR t^tR V 3R lltRtR# )zStest_main_wires_registry_health_client_and_indicator.<locals>.FakeGrokAuthOperationc               $    V ^8  d   QhRRRRRR/# r   rz   r8   aliasr   r	   r
   )r   s   "r   r   `test_main_wires_registry_health_client_and_indicator.<locals>.FakeGrokAuthOperation.__annotate__   s&     	I 	I3 	Is 	It 	Ir   c               	.   < SP                  R W34       R# )grok_import_from_legacy_homeNra   )rn   rz   r   rd   s   &$$r   import_from_legacy_homektest_main_wires_registry_health_client_and_indicator.<locals>.FakeGrokAuthOperation.import_from_legacy_home   s    MM94GHr   r
   N)r   r   r   r   r   r   r   s   r   FakeGrokAuthOperationStest_main_wires_registry_health_client_and_indicator.<locals>.FakeGrokAuthOperation   s    	I 	Ir   r   codexc                  *   < ] tR t^tR V 3R lltRtR# )zNtest_main_wires_registry_health_client_and_indicator.<locals>.FakeHealthClientc                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   [test_main_wires_registry_health_client_and_indicator.<locals>.FakeHealthClient.__annotate__   s     	0 	0d 	0r   c                	*   < SP                  R 4       R# )health_client_initNra   ru   s   &r   ro   Wtest_main_wires_registry_health_client_and_indicator.<locals>.FakeHealthClient.__init__   s    MM./r   r
   Nr   r   r   r   ro   r   r   s   r   FakeHealthClientNtest_main_wires_registry_health_client_and_indicator.<locals>.FakeHealthClient   s    	0 	0r   r   c                  R   < ] tR t^tR	R V 3R llltR V 3R lltR V 3R lltRtR# )
zKtest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicatorNc                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   Xtest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicator.__annotate__   s     	 	 	r   c           
     	:   < SP                  R VVVVVVV34       R# )indicator_initNra   	rn   registryhealth_clientclaude_registrygrok_registryprovider_servicesdevice_auth_flowdevice_auth_operationrd   s	   &&&&&&&&r   ro   Ttest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicator.__init__   s.     MM$!#!%$)	r   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   r           	# 	#4 	#r   c                	*   < SP                  R 4       R# buildNra   ru   s   &r   r   Qtest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicator.build       MM'"r   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   r           	! 	! 	!r   c                	*   < SP                  R 4       R# runNra   ru   s   &r   r   Otest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicator.run       MM% r   r
   NNNNNr   r   r   r   ro   r   r   r   r   s   r   FakeIndicatorKtest_main_wires_registry_health_client_and_indicator.<locals>.FakeIndicator   s!    	 	.	# 	#	! 	!r   r   rO   r#   claudegrokc                    < SP                  R V 34       V P                  R4      \        P                  P                  8X  d   S# V P                  R4      \        P                  P
                  8X  d   S# S# )registry_factorykind)rb   getr"   AccountRegistryKindCLAUDEGROK)kwargsrd   sentinel_claude_registrysentinel_grok_registrysentinel_registrys   ,r   r   Ntest_main_wires_registry_health_client_and_indicator.<locals>.registry_factory   sc    )623::f!7!K!K!R!RR++::f!7!K!K!P!PP))  r   c                 *   < S P                  R 4       S# )health_factoryra   )rd   sentinel_health_clients   r   r   Ltest_main_wires_registry_health_client_and_indicator.<locals>.health_factory   s    &'%%r   AccountRegistryAccountHealthClientDeviceAuthFlowc                 :   < S P                  R 4      ;'       g    S# )device_auth_flow_factoryra   )rd   sentinel_device_auth_flows   r   <lambda>Ftest_main_wires_registry_health_client_and_indicator.<locals>.<lambda>   s    89VV=VVr   DeviceAuthOperationc                >   < SP                  R W34      ;'       g    S# )r   ra   )r   flowrd   sentinel_device_auth_operations   &&r   r   r      s&    v}}.Ex-VW  *  *) *r   CodexLifecycleAdapterc                >   < SP                  R V 34      ;'       g    S# )codex_lifecycle_adapterra   )	operationrd   sentinel_codex_lifecycles   &r   r   r      s&    &--)BI(NO $ $#$r   CodexHealthAdapterc                >   < SP                  R V 34      ;'       g    S# )codex_health_adapterra   )clientrd   sentinel_codex_healths   &r   r   r      s     v}}&<f%EF__J__r   ClaudeAuthOperationc                >   < SP                  R V 34      ;'       g    S# )claude_auth_operationra   )r   rd   sentinel_claude_lifecycles   &r   r   r      s     (?'JKhhOhhr   ClaudeHealthClientc                 :   < S P                  R 4      ;'       g    S# )claude_health_client_factoryra   )rd   sentinel_claude_healths   r   r   r      s    <=WWAWWr   c                .   < SP                  R V 34       S# )grok_auth_operationra   )r   rd   sentinel_grok_lifecycles   &r   grok_auth_operation_factoryYtest_main_wires_registry_health_client_and_indicator.<locals>.grok_auth_operation_factory   s    ,h78&&r   GrokAuthOperationGrokHealthClientc                 :   < S P                  R 4      ;'       g    S# )grok_health_client_factoryra   )rd   sentinel_grok_healths   r   r   r      s    :;SS?SSr   c                  *   < ] tR t^tR V 3R lltRtR# )zRtest_main_wires_registry_health_client_and_indicator.<locals>.FakeProviderServicesc                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   _test_main_wires_registry_health_client_and_indicator.<locals>.FakeProviderServices.__annotate__   s     	T 	TD 	Tr   c               	0   < SP                  R WW434       R# )r   Nra   )rn   toolr   	lifecyclehealthrd   s   &$$$$r   ro   [test_main_wires_registry_health_client_and_indicator.<locals>.FakeProviderServices.__init__   s    MM.	RSr   r
   Nr   r   s   r   FakeProviderServicesRtest_main_wires_registry_health_client_and_indicator.<locals>.FakeProviderServices   s    	T 	Tr   r  ProviderServicesProviderServiceMapc                P   < SP                  R \        V 4      34      ;'       g    S# )provider_service_map)rb   tuple)	providersrd   sentinel_provider_maps   &r   r   r     s+    &--)?yAQ(RS ! ! !r   	Indicator:N
   Nr   r   rx   r`   r   r   claude_routing_rules.jsonr   r   r   r   r   r   r   r   r   r   c              3  D   "   T F  q^ ,          R8X  g   K  Vx  K  	  R# 5i)    r	  Nr
   ).0events   & r   	<genexpr>Gtest_main_wires_registry_health_client_and_indicator.<locals>.<genexpr>@  s     ^8G];]ees    
 r   r   r   NN)rt   r   >   r   r   r    )rt   r   )setenvobjectrP   r"   rR   osenvironr   CODEXr   r   nextlen)rK   r   re   r   r   r   r   r   r   r   r  provider_map_eventrd   r   r   r   r   r   r   r   r   r   r   r   r  r   s   &&          @@@@@@@@@@@@@@r   4test_main_wires_registry_health_client_and_indicatorr   n   s    F|%VWA A $I I %W-#X &%+X"%x"H &#X35!8"H0 0! !< .
HE.0DiP+H5)&1! !& .0ACST.0E~VV
 	* 	$ _
 h
 W'  35P ST T .0BDXY	! .]K!588@@@@@#;+??EEF	
 	$	002H%P+??FFG	
 	%	779OQVW+??DDE	
 
 67'   * v%%%%///#%68QRV\\\\%'EF&PPP"$:;vEEE#%=>&HHH)V333!#9:fDDD'61112288  
   	2299 ! 
   	2277 
   ^^^!!$%*** !&	 
	 	 	 "#;7E****r   c               $    V ^8  d   QhRRRRRR/# rY   r
   )r   s   "r   r   r   O  s$     & &#&/3&	&r   c                   V P                  \        R V4       RR R llpV P                  \        RV4       \        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! 4        RRR4       R#   + '       g   i     R# ; i)rO   Nc               (    V ^8  d   QhRRRRRRRR/# )	r   _pathr   r   zset[str] | Noner   z
str | Noner   r	   r
   )r   s   "r   r   =test_main_propagates_startup_exceptions.<locals>.__annotate__T  s,     - --"1-HR-	-r   c                    \        R 4      h)startup failed)rA   )r$  r   r   s   &&&r   exploding_seed?test_main_propagates_startup_exceptions.<locals>.exploding_seedT  s     +,,r   r#   r'  )matchr  )rP   r"   r4   r5   rA   rR   )rK   r   r(  s   && r   'test_main_propagates_startup_exceptionsr+  O  s_     .
HE-
 .0DnU	|+;	<	<##% 
=	<	<	<s   A;;B	c                    V ^8  d   QhRRRR/# r   r
   )r   s   "r   r   r   _  s     A Ad At Ar   c                    V R ,          p\         P                  ! VR4       \         P                  ! VR4       VP                  RR7      R8X  g   Q hR# )r   zfirst
zsecond
r   r   N)r"   _atomic_writer&   )r   destinations   & r   /test_atomic_write_replaces_existing_target_filer0  _  sI    11K((i@((jA  ' 2j@@@r   c               $    V ^8  d   QhRRRRRR/# rY   r
   )r   s   "r   r   r   g  s)     K K#K/3K	Kr   c                &  a . o ! V3R  lR4      pV P                  \        RV4       V P                  \        RRV3R ll4       V P                  \        RV4       V P                  \        RR 4        ! V3R	 lR
4      pV P                  \        RV4        ! R R4      pV P                  \        RV4       V P                  \        RR 4       \        P                  ! 4        SR,          RRRRVR,          3RRRRVR,          3R.	8X  g   Q hR# )c                     < ] tR tRt]P
                  P                  3R V 3R llltR V 3R lltV 3R lt	R R lt
R	tR
# )zEtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistryil  c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   Rtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistry.__annotate__m  s     	4 	4UY 	4r   c                	P   < Wn         SP                  R VP                   24       R# )z	registry:N)r   rb   r9   )rn   r   rd   s   &&r   ro   Ntest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistry.__init__m  s    IMMIdjj\23r   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   r5  q  s     	% 	%D 	%r   c                	*   < SP                  R 4       R# )migrateNra   ru   s   &r   rt   Ttest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistry.migrate_legacyq  s    MM)$r   c                	P   < SP                  R 4       \        RRRR/4      ! 4       .# )rx   ry   rz   r   r
   r{   ru   s   &r   rx   Jtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistry.listt  s(    MM&!B8:;;r   c                   V ^8  d   QhRR/# r   r
   )r   s   "r   r   r5  x  r   r   c                	    R # )r   r
   r   s   &r   r   Rtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistry.default_slugx  r   r   )r   N)r   r   r   r   r"   r   r  ro   rt   rx   r   r   r   s   r   r   Etest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeRegistryl  s5     6 J J P P 	4 	4	% 	%	<	 	r   r   rO   r#   Nc                *   < SP                  R V 34      # )r`   ra   rc   s   &&&r   r   Atest_main_seeds_rules_before_registry_bootstrap.<locals>.<lambda>  s    &--QU:Wr   r   r   c                     \        4       # rl   r  r
   r   r   r   rC    s    vxr   c                  R   < ] tR tRtR
R V 3R llltR V 3R lltR V 3R lltR	tR# )zFtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicatori  Nc                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   Stest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicator.__annotate__  s     	 	 	r   c                	   < ???SP                  R VP                  P                   RVP                  P                   RVP                  P                   24       R# )z
indicator::N)rb   r   r9   r   s	   &&&&&&&&r   ro   Otest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicator.__init__  sV     "#35JMMX]]001?3G3G3M3M2NaP]PbPbPhPhOijr   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   rH    r   r   c                	*   < SP                  R 4       R# r   ra   ru   s   &r   r   Ltest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicator.build  r   r   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   rH    r   r   c                	*   < SP                  R 4       R# r   ra   ru   s   &r   r   Jtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicator.run  r   r   r
   r   r   r   s   r   r   Ftest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeIndicator  s!    	 		# 	#	! 	!r   r   r  c                  .    ] tR tRtR R ltR R ltRtR# )zNtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeGrokAuthOperationi  c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   [test_main_seeds_rules_before_registry_bootstrap.<locals>.FakeGrokAuthOperation.__annotate__  s     	 	 	r   c                	    ?R # rl   r
   )rn   r   s   &&r   ro   Wtest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeGrokAuthOperation.__init__  s    r   c               $    V ^8  d   QhRRRRRR/# r   r
   )r   s   "r   r   rU    s!     	 	3 	s 	t 	r   c               	
    ??R # rl   r
   )rn   rz   r   s   &$$r   r   ftest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeGrokAuthOperation.import_from_legacy_home  s    er   r
   N)r   r   r   r   ro   r   r   r
   r   r   r   Ntest_main_seeds_rules_before_registry_bootstrap.<locals>.FakeGrokAuthOperation  s    		 	r   r   r   r   c                     \        4       # rl   rE  r
   r   r   r   rC    s    FHr   :N	   Nzregistry:codexr:  rx   r`   r   zregistry:clauder  zregistry:grokr  )rP   r"   rR   )rK   r   r   r   r   rd   s   &&   @r   /test_main_seeds_rules_before_registry_bootstrapr^  g  s    F  .
HEW
 .0A<P.0EGWX! !, .]K  .0CEZ[.0BDTU!":	001	778
 
 
 
r   c                    V ^8  d   QhRRRR/# )r   rK   rL   r   r	   r
   )r   s   "r   r   r     s      Q Q<N QSW Qr   c                  a \        \        4      p\        P                  P	                  R V4      pVf   Q hVP
                  f   Q h\        P                  P                  V4      pV\        P                  VP                  &   VP
                  P                  V4       / oR V3R llpV P                  VP                  RV4       VP                  4       ^ 8X  g   Q hSR,          RR.8X  g   Q hR# ) test_systray_codex_switcher_shimNc                    V ^8  d   QhRRRR/# )r   argsz	list[str]r   intr
   )r   s   "r   r   @test_shell_shim_delegates_to_systray_suite.<locals>.__annotate__  s      y S r   c                   < V SR &   ^ # )rc  r
   )rc  pytest_calls   &r   fake_pytest_mainDtest_shell_shim_delegates_to_systray_suite.<locals>.fake_pytest_main  s    "Fr   rR   rc  $tests/test_systray_codex_switcher.py-v)r   __file__	importlibutilspec_from_file_locationloadermodule_from_specsysmodulesri   exec_modulerP   r4   rR   )rK   	shim_pathspecmodulerh  rg  s   &    @r   *test_shell_shim_delegates_to_systray_suiterx    s    XI>>112TV_`D;;"""^^,,T2F#CKK		KKF#%'K  v/?@;;=Av#I4"PPPPr   c                   V ^8  d   QhRR/# rr   r
   )r   s   "r   r   r     s     1 1T 1r   c            	        \         P                  P                  R 4      R8X  d   \        P                  ! R4       \        \        4      P                  4       P                  P                  p V R,          R,          p\         P                  P                  4       p\        P                  VR&   \        P                  ! R\        V4      .V RRRVR	7      pVP                  ^ 8X  g   Q VP                   4       hR
# )"SYSTRAY_CODEX_SWITCHER_SHIM_ACTIVE1z@shell shim subprocess test must not recurse under shim executiontestsztest_systray_codex_switcher.pyPYTHONshTF)cwdcapture_outputtextcheckenvN)r  r  r   r4   skipr   rl  resolveparentcopyrr  
executable
subprocessr   r8   
returncodestderr)	repo_rootru  r  results       r   +test_shell_shim_runs_when_invoked_via_shellr    s    	zz~~:;sBVWX&&(//66IG#&FFI
**//
CNNCM^^	s9~F !06==0!r   c                   V ^8  d   QhRR/# )r   r   rd  r
   )r   s   "r   r   r     s     G Gc Gr   c                 2    \         P                  ! R R.4      # )rj  rk  )r4   rR   r
   r   r   rR   rR     s    ;;>EFFr   __main__)#__doc__
__future__r   importlib.utilrm  r$   r  pathlibr   r  rr  r4   r]   insertr8   rl  r  parentsr"   r)   r-   r1   r<   rE   rI   rW   r   r+  r0  r^  rx  r  rR   r   rQ   r
   r   r   <module>r     s    #   	   
  3tH~--/77:; < &N	R# ^+B& AK\Q*1,G z
TV
 r   