+
    5mjm  c                  R   ^ 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t^ RIHt ^ RIHt ^ RIt]
P$                  P'                  ^ ]! ]! ]4      P-                  4       P.                  ^,          4      4       ^ RIHtHtHtHt ^ RIHtHtH t H!t!H"t" R R lt#R	RR
RRR/R R llt$R R lt% ! R R4      t& ! R R4      t' ! R R4      t( ! R R4      t) ! R R4      t*R R lt+R R lt,R R lt-R  R! lt.R" R# lt/R$ R% lt0R& R' lt1R( R) lt2R* R+ lt3R, R- lt4R. R/ lt5R# )0    )annotationsN)Callable)Path)Account
AccountRefAccountRegistryAccountRegistryKind)ClaudeAuthOperationClaudeLoginPromptClaudeLoginSessionCommandResultSTATUS_TIMEOUT_SECSc                    V ^8  d   QhRRRR/# )   tmp_pathr   returnr    )formats   "k/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_claude_auth_operation.py__annotate__r      s      T o     c                    V R ,          pV R,          pVP                  4        VP                  4        \        V R,          VV\        P                  V R,          R7      # )zlegacy-claudezlegacy-codextrayz.claude.json)base_dirlegacy_codex_homelegacy_claude_homekindactive_claude_json)mkdirr   r   CLAUDE)r   r   r   s   &  r   _make_registryr       s\    !O3 >1F"+- ''#n4 r   emailplan
account_idc               4    V ^8  d   QhRRRRRRRRRRR	RR
R/# )r   slugstraliasaccount_homer   r!   z
str | Noner"   r#   r   r   r   )r   s   "r   r   r   '   sN      
 
    r   c          	     8    \        \        R V 4      VVVVVR7      # )claude)refr'   r(   r!   r"   r#   )r   r   )r%   r'   r(   r!   r"   r#   s   &&&$$$r   _accountr,   '   s*     x&! r   c                    V ^8  d   QhRRRR/# )r   pathr   r   zdict[str, object]r   )r   s   "r   r   r   :   s     8 8T 8/ 8r   c                N    \         P                  ! V P                  R R7      4      # )utf-8encoding)jsonloads	read_text)r.   s   &r   
_read_jsonr6   :   s    ::dnngn677r   c                  6    ] tR t^>tR R ltRR/R R lltRtR# )_Runnerc                   V ^8  d   QhRR/# r   r   Noner   )r   s   "r   r   _Runner.__annotate__?   s     1 14 1r   c                	     Wn         . V n        R # N_handlercallsselfhandlers   &&r   __init___Runner.__init__?       .0
r   timeoutNc               (    V ^8  d   QhRRRRRRRR/# 	r   command	list[str]
config_dirr   rH   float | Noner   r   r   )r   s   "r   r   r<   C   s8     N NN 	N
 N 
Nr   c               	|    V P                   P                  R \        V4      RVRV/4       V P                  WVR7      # )rK   rM   rH   )rM   rH   )rA   appendlistr@   )rC   rK   rM   rH   s   &&$$r   __call___Runner.__call__C   sC     	

4=j7	
 }}WW}MMr   r?   __name__
__module____qualname____firstlineno__rE   rR   __static_attributes__r   r   r   r8   r8   >   s    1N
 !%N Nr   r8   c                  >    ] tR t^TtR R ltR	R R lltR R ltRtR# )
_FakeLoginStdoutc                    V ^8  d   QhRRRR/# r   processz'_FakeLoginProcess'r   r;   r   )r   s   "r   r   _FakeLoginStdout.__annotate__U   s         3    r   c                	    Wn         R # r>   _processrC   r^   s   &&r   rE   _FakeLoginStdout.__init__U   s    r   c                    V ^8  d   QhRRRR/# )r   _sizeintr   r&   r   )r   s   "r   r   r_   X   s     , ,# ,s ,r   c                	6    V P                   P                  4       # r>   )rb   _read_stdout)rC   rf   s   &&r   read_FakeLoginStdout.readX   s    }}))++r   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r   r_   [         t r   c                	    R # r>   r   rC   s   &r   close_FakeLoginStdout.close[       r   ra   N))rU   rV   rW   rX   rE   rj   rp   rY   r   r   r   r[   r[   T   s     , r   r[   c                  F    ] tR t^_tR R ltR R ltR R ltR R ltR	tR
# )_FakeLoginStdinc                    V ^8  d   QhRRRR/# r]   r   )r   s   "r   r   _FakeLoginStdin.__annotate__`   s     $ $ 3 $ $r   c                	     Wn         . V n        R # r>   rb   writesrc   s   &&r   rE   _FakeLoginStdin.__init__`   s    !#r   c                    V ^8  d   QhRRRR/# )r   textr&   r   rg   r   )r   s   "r   r   rw   d   s      # # r   c                	N    V P                   P                  V4       \        V4      # r>   )rz   rP   len)rC   r}   s   &&r   write_FakeLoginStdin.writed   s    4 4yr   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r   rw   h   s      t r   c                	    V P                   P                  R P                  V P                  4      4       V P                  P	                  4        R# ) N)rb   submit_codejoinrz   clearro   s   &r   flush_FakeLoginStdin.flushh   s1    !!"''$++"67r   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r   rw   l   rm   r   c                	    R # r>   r   ro   s   &r   rp   _FakeLoginStdin.closel   rr   r   ry   N)	rU   rV   rW   rX   rE   r   r   rp   rY   r   r   r   ru   ru   _   s    $ r   ru   c                      ] tR t^ptRRR^ RR/R R lltR R	 ltR
 R ltR R ltR R ltRR R llt	R R lt
R R ltRtR# )_FakeLoginProcessoutputr   
returncodeclose_on_startTc               (    V ^8  d   QhRRRRRRRR/# )	r   r   r&   r   
int | Noner   boolr   r;   r   )r   s   "r   r   _FakeLoginProcess.__annotate__q   s:     G G G 	G
 G 
Gr   c               	@   \        V 4      V n        \        V 4      V n        . V n        . V n        R V n        R V n        RV n        \        P                  ! 4       V n        \        V4      V n        W n        V F  pK  	  V'       d   T P                  Ve   TM^ 4       R# R# )FN)r[   stdoutru   stdin
wait_callssubmitted_codes
terminatedkilledr   	threadingEvent_exit_eventrQ   _stdout_queue_returncode_on_submitcomplete)rC   r   r   r   _chunks   &$$$ r   rE   _FakeLoginProcess.__init__q   s     't,$T*
.0*,&*$??,/3F|%/"F MM
(>*AF r   c                   V ^8  d   QhRR/# )r   r   r&   r   )r   s   "r   r   r      s      c r   c                	    V P                   '       g   V P                  P                  R 4       K/  V P                   P                  ^ 4      pVf   R# V# )gMbP?r   )r   r   waitpop)rC   chunks   & r   ri   _FakeLoginProcess._read_stdout   sE    $$$!!%(""&&q)=r   c                    V ^8  d   QhRRRR/# )r   coder&   r   r;   r   )r   s   "r   r   r      s     c c c cr   c                	    V P                   e   R # V P                  P                  V4       T P                  V P                  e   V P                  4       R # ^ 4       R # r>   )r   r   rP   r   r   )rC   r   s   &&r   r   _FakeLoginProcess.submit_code   sF    ??&##D)D4N4N4Zd00b`abr   c                    V ^8  d   QhRRRR/# )r   r   rg   r   r;   r   )r   s   "r   r   r      s      3 4 r   c                	    V P                   e   R # Wn         V P                  P                  R 4       V P                  P	                  4        R # r>   )r   r   rP   r   set)rC   r   s   &&r   r   _FakeLoginProcess.complete   s:    ??&$!!$'r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s      j r   c                	    V P                   # r>   )r   ro   s   &r   poll_FakeLoginProcess.poll   s    r   Nc                    V ^8  d   QhRRRR/# )r   rH   rN   r   rg   r   )r   s   "r   r   r      s      L C r   c           	     	   V P                   P                  V4       V P                  e   V P                  # V P                  P	                  V4      '       g   \
        P                  ! . ROVR7      hV P                  pR q2VJ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      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR ;p;rCV P                  # )N)cmdrH   py0rC   py2py5assert %(py7)spy7r*   authlogin
--claudeaiis not)z6%(py2)s
{%(py2)s = %(py0)s.returncode
} is not %(py5)s)r   rP   r   r   r   
subprocessTimeoutExpired
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)rC   rH   @py_assert1@py_assert4@py_assert3@py_format6@py_format8s   &&     r   r   _FakeLoginProcess.wait   s    w'??&??"$$W--++0Ycjkk*d*d***********t****t******d********r   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r   r      s      4 r   c                	6    R V n         V P                  R4       R# )TNi)r   r   ro   s   &r   	terminate_FakeLoginProcess.terminate   s    cr   c                   V ^8  d   QhRR/# r:   r   )r   s   "r   r   r      s      d r   c                	6    R V n         V P                  R4       R# )TNi)r   r   ro   s   &r   kill_FakeLoginProcess.kill   s    br   )
r   r   r   r   r   r   r   r   r   r   r>   )rU   rV   rW   rX   rE   ri   r   r   r   r   r   r   rY   r   r   r   r   r   p   sR    G G "#	G
  $G,c r   r   c                  J    ] tR t^tR R ltRRRRRRRRRRR	R/R
 R lltRtR# )_LoginPopenFactoryc                    V ^8  d   QhRRRR/# )r   rD   z Callable[..., _FakeLoginProcess]r   r;   r   )r   s   "r   r   _LoginPopenFactory.__annotate__   s     1 1 @ 1T 1r   c                	     Wn         . V n        R # r>   r?   rB   s   &&r   rE   _LoginPopenFactory.__init__   rG   r   r   Nr   stderrr}   bufsizeenvc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   rK   rL   r}   zbool | Noner   r   r   dict[str, str] | Noner   r   r   )r   s   "r   r   r      s<     
 

 
 
 #
 

r   c               	    V P                   P                  R \        V4      RTRTRTRTRTR\        T;'       g    / 4      /4       V P	                  VVVVVVVR7      # )rK   r   r   r   r}   r   r   )r   r   r   r}   r   r   )rA   rP   rQ   dictr@   )rC   rK   r   r   r   r}   r   r   s   &&$$$$$$r   rR   _LoginPopenFactory.__call__   sy     	

4=&&7tCII2
	
 }}  
 	
r   r?   rT   r   r   r   r   r      sM    1
 	

 
 
 !
 #
 &*
 
r   r   c                    V ^8  d   QhRRRR/# r   r   r   r   r;   r   )r   s   "r   r   r      s$     MG MGPT MGY] MGr   c                  a \        V 4      pR oRR/R R llpRR/R V3R lllp\        V4      p\        V4      p\        \	        WVR7      P                  R	R
R7      4      pV Uu. uF  qwP                  NK  	  pp. R(OqV	8H  q'       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;rVP                  ^ ,          R,          p. R+OqV	8H  q'       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;rVP                  ^ ,          R,          p. R,OqV	8H  q'       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;rVP                  ^ ,          R,          q\        8H  q'       g   \        P                  ! R)V
3R-V\        34      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;rVR.,          P"                  pRqV
JpV'       g   \        P                  ! R/V3R0W3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;pp
VP$                  pRpVV8H  q'       g   \        P                  ! R)V	3R1VV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;p	pVP&                  pRpVV8H  q'       g   \        P                  ! R)V	3R2VV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;p	pVP(                  pRpVV8H  q'       g   \        P                  ! R)V	3R3VV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;p	pVP*                  pRpVV8H  q'       g   \        P                  ! R)V	3R4VV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;p	pVP,                  p
RpV
V,          p\/        V4      pR RR!RR"R/pVV8H  pV'       EgJ   \        P                  ! R)V3R5V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\        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VP                   Uu. uF  pVR,          ^,          NK  	  ppR.qV	8H  q'       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;rR# u upi u upi )6BIf the browser didn't open, visit: https://auth.example.com/login
rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   Wtest_add_runs_login_with_email_hint_persists_identity_and_commits.<locals>.__annotate__   2     
 

 
 	

 

r   c                  . ROq0V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;rCV\        8H  qD'       g   \         P                  ! RV3R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                  ! \        4      '       d   \         P
                  ! \        4      MR	/,          pR
RV/,          p\        \         P                  ! V4      4      hRp\        ^ \        P                  ! RR/4      R7      # r*   r   rK   py3assert %(py5)sr   NrH   r   r   zassert %(py4)spy4loggedInTr   r   r*   r   statusz--json==z%(py0)s == %(py3)s)z%(py0)s == %(py2)sr   r   r   r   r   r   r   r   r   r   r3   dumps	rK   rM   rH   @py_assert2r   @py_format4r   @py_format3@py_format5s	   &$$      r   status_handlerYtest_add_runs_login_with_email_hint_persists_identity_and_commits.<locals>.status_handler       A@@@@@@@w@@@@@@w@@@@w@@@@@@@@@@@@------w-------w----w---------------------::z401
 	
r   r   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      s-     Y YY #Y
 
Yr   c                 < . ROq0V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q1VJ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qwV9   q3'       g   \         P                  ! RV3R Wq3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;rs\        VR,          4      pVR
,          P                  \        P                  ! RRR//4      RR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        S	^ RR7      # )!r*   r   rK   r   r   r   Nr   CLAUDE_CONFIG_DIRpy1.credentials.jsonclaudeAiOauthsubscriptionTypepror0   r1   claude.jsonoauthAccountemailAddressUser@Example.comorganizationUuidOrg-123organizationRateLimitTiermaxTr   r   r   r*   r   r   r   z--emaillogin@example.comr   r   r   z%(py0)s is not %(py3)sinz%(py1)s in %(py3)sr   r   r   r   r   r   r   r   r   
write_textr3   r   r   )
rK   r   _kwargsr  r   r  r   @py_assert0rM   login_outputs
   &$,      r   login_handlerXtest_add_runs_login_with_email_hint_persists_identity_and_commits.<locals>.login_handler   s    dcccccccwccccccwccccwcccccccccccc$sss$")c)))))")))"))))))c))))c))))))))#123
	)	)55JJ*<e)DEF 	6 	
 
m	#//JJ"&(:*I3U%  	0 	
 !SWXXr   runnerlogin_popenTeam Accountr  
login_hintr  r   assert %(py6)spy6rK   r   r   r   r   r   r   accountteam-accountr   r   r   user@example.comorg-123r  account_identity.jsonr!   org_idsubscription_typer6   py8py11zassert %(py13)spy13startedbrowser-waitingsuccessr   z%(py1)s == %(py4)sr  r   )z%(py1)s == %(py3)srs   r   r  z,%(py2)s
{%(py2)s = %(py0)s.slug
} == %(py5)sz-%(py2)s
{%(py2)s = %(py0)s.email
} == %(py5)sz2%(py2)s
{%(py2)s = %(py0)s.account_id
} == %(py5)sz,%(py2)s
{%(py2)s = %(py0)s.plan
} == %(py5)s)z_%(py8)s
{%(py8)s = %(py0)s((%(py3)s
{%(py3)s = %(py1)s.account_home
} / %(py5)s))
} == %(py11)s)r    r8   r   rQ   r	   addr   r   r   r   r   r   rA   r   r   r   r   r/  r%   r!   r#   r"   r(   r6   )r   registryr  r%  r(  login_factoryeventseventr#  r   r  r  @py_format7r  r   r/  r   r   r   @py_assert6@py_assert7@py_assert10@py_assert9@py_format12@py_format14callr$  s   &                         @r   Atest_add_runs_login_with_email_hint_persists_identity_and_commitsrO     s}   h'HXL
 !%	
Y &*Y Y8 ^$F&}5MHOSS* 	T 	
F %++F5JJFX+/XX/XXXXXX+XXX+XXX/XXXXXXXXXq!),  1  1    ,   ,    1        <<?9%O)OO)OOOOOO%OOO%OOO)OOOOOOOOO<<?9%<)<<<<<<%)<<<<%<<<<<<)<<<<<)<<<<<<<<<Rj  G$777$<<)>)<>)))))<>))))))7))))7)))<)))>))))))))==...=......=.......7....7...=............*************7****7**************<< 5 <5     <5      7    7   <   5        ** -D *-DD :DE #)UJ E J    	E J   	  	:   	:   	  	g   	g   	*   	-D   	E   	 J      	  
 ,2<<8<4DOA<F8XJFJFFFFF8FFF8FFFJFFFFFFFF- ,, 9s   'g1	g6c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   '  s     ?> ?>T ?>VZ ?>r   c                	   \        V 4      pVP                  R R4      pVR,          P                  \        P                  ! RRRRRR/4      R	R
7       VP                  4       ^ ,          pRR/R R llpRR/R R llp\        V4      p\        V4      p\        \        WVR7      P                  RRR7      4      pV U	u. uF  qP                  NK  	  p
p	. R%OqV8H  q'       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
;rVP                   ^ ,          R,          p
. R(OqV8H  q'       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
;rVR),          qP"                  qV8H  q'       g   \        P                  ! R&V3R*W3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
;rVP                  4        Uu. uF  pVP*                  NK  	  p
pR .qV8H  q'       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
;rVP,                  pRpVV,          pVP.                  pV! 4       pV'       * pV'       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      R\        P                  ! V4      R$\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p;p;p;ppR# u up	i u upi )+existingExistingr3  r!   zexisting@example.comr4  r2  r5  r  r0   r1   rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   Ttest_add_omits_blank_email_hint_and_rejects_duplicate_identity.<locals>.__annotate__6  8     R RR R 	R
 
Rr   c               H    \        ^ \        P                  ! RR/4      R7      # r   r   Tr   r   r3   r   rK   rM   rH   s   &$$r   r  Vtest_add_omits_blank_email_hint_and_rejects_duplicate_identity.<locals>.status_handler6       $**j$=O2PQQr   r   c               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   rU  >  s(     
 

 #

 

r   c               d   . ROq0V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q1VJ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qwV9   q3'       g   \         P                  ! RV3RWq3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;rs\        VR,          4      pVR
,          P                  RRR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        R^ RR7      # ) r*   r   rK   r   r   r   Nr   r  r  r  {}r0   r1   r  r  r  zExisting@Example.comr  ORG-123r  teamr   Tr  r   r   r   r   r  r  r  r   )	rK   r   r"  r  r   r  r   r#  rM   s	   &$,      r   r%  Utest_add_omits_blank_email_hint_and_rejects_duplicate_identity.<locals>.login_handler>  s    DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC$sss$")c)))))")))"))))))c))))c))))))))#123
	)	)55dW5M	m	#//JJ"&(>*I3V%  	0 	
 !X
 	
r   r'  	Duplicatez  r+  r  r   r-  r.  rK   r   r   r   r   	duplicatesassert not %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = (%(py2)s
{%(py2)s = %(py0)s.accounts_dir
} / %(py4)s).exists
}()
}r   rC  r   py9r:  r;  rollback	collisionr   r=  r   rs   z1%(py3)s
{%(py3)s = %(py1)s.collision
} == %(py5)s)r    add_dirr!  r3   r   rQ   r8   r   r	   rB  r   r   r   r   r   r   rA   ri  r   r   r   r%   accounts_direxists)r   rC  existing_homerR  r  r%  r(  rD  rE  rF  r#  r   r  r  rG  r   r   r   r/  r   @py_assert5rH  @py_assert8rJ  @py_format11s   &                        r   >test_add_omits_blank_email_hint_and_rejects_duplicate_identityrr  '  s!   h'H$$Z<M,,88

/)#U	
  9 	 }}q!HR !%	R
 &*
: ^$F&}5MHOSST_lpSqF %++F5JJFf+/ff/ffffff+fff+fff/fffffffffq!),Y0YY0YYYYYY,YYY,YYY0YYYYYYYYY":++8++++++++:+++++++++8++++8++++++++(08WGLLH8ZLHLHHHHH8HHH8HHHLHHHHHHHH%%==%3=3;;=;===================%======;============	 , 9s   >R9R>c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   i  s     ; ;d ;W[ ;r   c                f
  a \        V 4      pR oR V3R llp\        V4      p\        \        WR7      P	                  RRR7      4      pV Uu. uF  qUP
                  NK  	  pp. ROqvV8H  q'       gy   \        P                  ! R V3R!Wg34      R\        P                  ! V4      R\        P                  ! V4      /,          p	R
RV	/,          p
\        \        P                  ! V
4      4      hR;p;r. qtR",          qP                  qq'       g   R	qpSV9  q'       Eg9   RR\        P                  ! V4      R\        P                  ! V4      /,          qP                  V4       V'       g1   RR\        P                  ! X4      /,          pVP                  V4       \        P                  ! V^4      / ,          p\        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V/,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;p;p;rVR",          qfP"                  pRpVVJq'       g   \        P                  ! R%V3R&VV3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VP                  q! 4       p. qV8H  pV'       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      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;p;ppVP$                  pRq~V,          pVP&                  q! 4       pV'       * pV'       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      R\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;p;p;p;ppR# u upi )(zsecret@example.com token-123c                    V ^8  d   QhRRRR/# r   rK   rL   r   r   r   )r   s   "r   r   Utest_add_failure_does_not_leak_subprocess_output_and_rolls_back.<locals>.__annotate__m  s"     S SS 
Sr   c                  < . R	Oq V8H  q3'       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;r2\        S^RR7      # )r*   r   rK   r   r   r   NTr  r   r   r   	r   r   r   r   r   r   r   r   r   )rK   r"  r  r   r  r   secrets   &,    r   r%  Vtest_add_failure_does_not_leak_subprocess_output_and_rolls_back.<locals>.login_handlerm  su     DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC 1TRRr   r)  BrokenNr+  r  r   r   r-  r.  z$%(py7)s
{%(py7)s = %(py5)s.message
}r   r   z%(py10)spy10r   rz  r8  zassert %(py15)spy15r   assert %(py8)sr6  rC  r   assert %(py9)srf  brokenre  )r:  r;  rh  failurer   r=  rs   )not in)z%(py0)s not in (%(py13)s)r   z1%(py3)s
{%(py3)s = %(py1)s.error
} is not %(py6)szC%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.list
}()
} == %(py7)s)r    r   rQ   r	   rB  r   r   r   r   r   r   messagerP   _format_boolopr   r   r   errorrl  rm  )r   rC  r%  rD  rE  rF  r#  r   r  r  rG  r   rH  rK  r   r   rq  rL  rM  @py_format16ro  @py_format9@py_format10rp  rJ  rz  s   &                        @r   ?test_add_failure_does_not_leak_subprocess_output_and_rolls_backr  i  s   h'H+FS S '}5M%hJNNxdhNijF$*+F5JJFd+/dd/dddddd+ddd+ddd/ddddddddd3*3,,3,36333333*333,3333,333333333333363333333633336333333333":''4'4'''''4''':''''''4''''''''== =? b b     ?      8    8   =   ?   b        %%::0:088:8:::::::::::::::::::%::::::8::::::::::::	 ,s   T.c               $    V ^8  d   QhRRRRRR/# r   r   r   monkeypatchzpytest.MonkeyPatchr   r;   r   )r   s   "r   r   r     s&     %: %:%:#%: 
%:r   c                   \        V 4      pVP                  R R4       R R lp\        V4      p\        W$R7      P	                  RRR7      p\        V4      qfP                  pRqV8H  q'       Eg3   \        P                  ! R1V	3R2Wx3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      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;r\        V4      qfP                  pRqV8H  q'       Eg3   \        P                  ! R1V	3R2Wx3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      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;r\        V4      pVP                  pRq}V8H  q'       g   \        P                  ! R1V3R3W3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;rVP                  pRpRp\!        VVR7      pVV8H  q'       EgJ   \        P                  ! R1V3R4V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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 4       \'        V4      pV Uu. uF  pVP                  NK  	  ppR!R".pVV8H  qf'       gz   \        P                  ! R1V3R5VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR#RV/,          p\        \        P                  ! V4      4      hR;p;rnR$p. pVR6,          pVP(                  qq'       g   RpTpVV9   qf'       Eg   R%R\        P                  ! V4      R\        P                  ! V4      /,          qP+                  V
4       V'       g1   R&R'\        P                  ! X4      /,          pVP+                  V4       \        P,                  ! V^4      / ,          p\        P                  ! R7V3R8VV34      R\        P                  ! V4      R(V/,          pR)R*V/,          p\        \        P                  ! V4      4      hR;p;p;p;p;p;ppVR6,          pVP.                  pRpVVJqw'       g   \        P                  ! R9V3R:VV3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VP&                  q! 4       p. qV	8H  pV'       g   \        P                  ! R1V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;pp	VP0                  pR/qV,          pVP2                  q! 4       pV'       * pV'       g   R0R	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\        \        P                  ! V4      4      hR;p;p;p;p	;ppR# u upi )<(claude_auth_operation.LOGIN_TIMEOUT_SECSg      ?c                    V ^8  d   QhRRRR/# rv  r   )r   s   "r   r   Stest_add_login_timeout_rolls_back_and_reports_timeout_message.<locals>.__annotate__  s     	
 	
	
 
	
r   c                   . R
Oq V8H  q3'       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;r2\        R^ RR	7      # )r*   r   rK   r   r   r   N`If the browser didn't open, visit: https://auth.example.com/login
Paste code here if prompted > Fr  r   r   r   ry  rK   r"  r  r   r  r   s   &,    r   r%  Ttest_add_login_timeout_rolls_back_and_reports_timeout_message.<locals>.login_handler  s{     DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC v 
 	
r   r|  StuckNr+  r:  r   nextr  rE  r   r   r6  r   assert %(py10)sr~  r;  code_requiredr   r   r   https://auth.example.com/loginr   urlraw_textr   r
   r.  assert %(py12)spy12g{Gz?rh  r  r-  z	timed outz$%(py8)s
{%(py8)s = %(py6)s.message
}z%(py11)sr7  py14zassert %(py16)spy16r  rC  r  rf  stuckre  r   zJ%(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}.kind
} == %(py8)sz,%(py2)s
{%(py2)s = %(py0)s.kind
} == %(py5)szd%(py2)s
{%(py2)s = %(py0)s.prompt
} == %(py10)s
{%(py10)s = %(py4)s(url=%(py6)s, raw_text=%(py8)s)
}r=  rs   r  )z%(py1)s in (%(py14)s)r   r  r  )r    setattrr   r	   rB  r  r   r   r   r   r   r   r   r   r   promptr
   timesleeprQ   r  rP   r  r  rl  rm  )r   r  rC  r%  rD  rE  r  r   rI  rH  r  rq  r  r   r   r   r   ro  rK  @py_format13	remainingrF  r#  r  rG  rJ  rL  @py_format15@py_format17r  rp  s   &&                             r   =test_add_login_timeout_rolls_back_and_reports_timeout_messager    s?    h'HBCH	
 '}5M EII'^bIcF<))	)	)))))))))))4))))4))))))))))))))<))))))	))))))))<11 11 111111111111411114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1LM0000000000000=0000=00000000000000 ,V#4,V$  $     $     =   =        #4   #4   ,  V   $        
 	JJtVI$-.I5EJJII.:y2II.2IIIIII.2IIII.III2IIIIIIIII79R=7=0070B7B7;777777=777077770777B7777777777;777;777777777R=*=*d*d*****d***=******d********== =? b b     ?      8    8   =   ?   b        %%99/9/77979999999999999999999%9999997999999999999	 /s   ic               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r     s+      G  G G# G 
 Gr   c                  a \        V 4      pVP                  R R4       RoR V3R llp\        V\        V4      R7      P	                  RRR7      p\        V4      qUP                  pR	qvV8H  q'       Eg3   \        P                  ! R$V3R%Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\        V4      qUP                  pRqvV8H  q'       Eg3   \        P                  ! R$V3R%Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\        V4      pVP                  pRqlV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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP                  pRp\!        VSR7      pVV8H  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\        P                  ! V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                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRR V/,          p\        \        P                  ! V4      4      hR;p;p;ppVP"                  pRqlVJ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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP"                  P$                  P'                  4        V Uu. uF  pVP                  NK  	  ppR!R".pVV8H  qU'       gz   \        P                  ! R$V3R*VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR#RV/,          p\        \        P                  ! V4      4      hR;p;r]R# u upi )+r  g      @r   c                    V ^8  d   QhRRRR/# rv  r   )r   s   "r   r   Rtest_add_code_required_when_login_url_is_ready_before_prompt.<locals>.__annotate__  s"     Z ZZ 
Zr   c                  < . R	Oq V8H  q3'       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;r2\        S^ RR7      # )r*   r   rK   r   r   r   NFr  r   r   r   ry  )rK   r"  r  r   r  r   r$  s   &,    r   r%  Stest_add_code_required_when_login_url_is_ready_before_prompt.<locals>.login_handler  sv     DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC SXYYr   r|  z
Needs CodeNr+  r:  r   r  r  rE  r   r   r6  r  r~  r;  r  r   r   r   r  r  r   r
   r.  r$  rf  assert %(py11)sr7  rh  r  r-  r   r  r  zb%(py2)s
{%(py2)s = %(py0)s.prompt
} == %(py9)s
{%(py9)s = %(py4)s(url=%(py6)s, raw_text=%(py7)s)
}r   z3%(py2)s
{%(py2)s = %(py0)s.session
} is not %(py5)sr=  r    r  r	   r   rB  r  r   r   r   r   r   r   r   r   r   r  r
   sessionr^   r   )r   r  rC  r%  rE  r  r   rI  rH  r  rq  r  r   r   r   r   ro  rp  r  rL  rF  r#  r  rG  r$  s   &&                      @r   <test_add_code_required_when_login_url_is_ready_before_promptr    s    h'HBCHXLZ Z !&}5 
c,4c( 
 <))	)	)))))))))))4))))4))))))))))))))<))))))	))))))))<11 11 111111111111411114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1LM0000000000000=0000=00000000000000 ,#4,$  $     $     =   =        #4   #4   ,         $           ,,,,,,, ,,,,,,=,,,,=,,, ,,,,,,,,,,,!!++-$*+F5EJJFF+
I/FF+/FFFFFF+/FFFF+FFF/FFFFFFFFF+s   6]c               $    V ^8  d   QhRRRRRR/# r  r   )r   s   "r   r   r     s+     G GG#G 
Gr   c                P   \        V 4      pVP                  R R4       R R lp\        V\        V4      R7      P	                  RRR7      p\        V4      qUP                  pRqvV8H  q'       Eg3   \        P                  ! R!V3R"Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\        V4      qUP                  pRqvV8H  q'       Eg3   \        P                  ! R!V3R"Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\        V4      pVP                  pRqlV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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP                  pRpRp\!        VVR7      pVV8H  q'       EgJ   \        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      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      /,          p
RRV
/,          p\        \        P                  ! V4      4      hR;p;p;p;ppVP"                  pRqlVJ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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP"                  P$                  P'                  4        V Uu. uF  pVP                  NK  	  ppRR.pVV8H  qU'       gz   \        P                  ! R!V3R'VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR RV/,          p\        \        P                  ! V4      4      hR;p;r]R# u upi )(z.claude_auth_operation.CODE_ENTRY_FALLBACK_SECSg{Gz?c                    V ^8  d   QhRRRR/# rv  r   )r   s   "r   r   Mtest_add_code_required_when_current_cli_emits_no_prompt.<locals>.__annotate__  s"     P PP 
Pr   c                   . R
Oq V8H  q3'       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;r2\        R^ RR	7      # )r*   r   rK   r   r   r   r   NFr  r   r   r   ry  r  s   &,    r   r%  Ntest_add_code_required_when_current_cli_emits_no_prompt.<locals>.login_handler  st     DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC qOOr   r|  z
Silent CLINr+  r:  r   r  r  rE  r   r   r6  r   r  r~  r;  r  r   r   r   r  r   r
   r.  r  r  rh  r  r-  r   r  r  r  r   r  r=  r  )r   r  rC  r%  rE  r  r   rI  rH  r  rq  r  r   r   r   r   ro  rK  r  rF  r#  r  rG  s   &&                     r   7test_add_code_required_when_current_cli_emits_no_promptr    s    h'HH$OP !&}5 
c,4c( 
 <))	)	)))))))))))4))))4))))))))))))))<))))))	))))))))<11 11 111111111111411114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1LM0000000000000=0000=00000000000000IIbI#4b#II#IIIIII#IIIIIII=IIII=IIIIIIIII#4IIII#4IIIIIIbIII#IIIIIIIII  ,,,,,,, ,,,,,,=,,,,=,,, ,,,,,,,,,,,!!++-$*+F5EJJFF+
I/FF+/FFFFFF+/FFFF+FFF/FFFFFFFFF+s   <\#c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     Q Q$ Q4 Qr   c                  a \        V 4      pR oRpRR/R R llpRR/R V3R lllp\        V4      p\        V4      p\        WVR	7      pVP	                  R
RR7      p\        V4      qP                  p
RqV8H  q'       Eg3   \        P                  ! R3V3R4W3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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p	;p
;r\        V4      qP                  p
RqV8H  q'       Eg3   \        P                  ! R3V3R4W3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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p	;p
;r\        V4      pVP                  pRp
VV
8H  pV'       g   \        P                  ! R3V3R5VV
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;pp
VP                  pRp\!        VVR7      pVV8H  pV'       Eg   \        P                  ! R3V3R6V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R \        P                  ! V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;p;p;ppVP"                  p	\%        V	\&        4      pV'       EgO   R%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                  ! \&        4      '       d   \        P                  ! \&        4      MR'R \        P                  ! V4      /,          p\        \        P                  ! V4      4      hR;p	pVP)                  VP"                  R(4       VP"                  pVP*                  pVP,                  pR).pVV8H  q'       g   \        P                  ! R3V3R7VV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      R \        P                  ! V4      R"\        P                  ! V4      /,          pR#R$V/,          p\        \        P                  ! V4      4      hR;p;p;p;pp\/        V4      pV Uu. uF  pVP                  NK  	  ppR*.pVV8H  q'       gz   \        P                  ! R3V	3R8VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR+R V/,          p\        \        P                  ! V4      4      hR;p;p	pVR9,          P0                  pRp	VV	JpV'       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;pp	VP2                  pR.p
VV
8H  pV'       g   \        P                  ! R3V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      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;pp
VP4                  pR/p
VV
8H  pV'       g   \        P                  ! R3V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      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;pp
VP6                  pR0p
VV
8H  pV'       g   \        P                  ! R3V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      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;pp
VP8                  pR1p
VV
8H  pV'       g   \        P                  ! R3V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      R\        P                  ! V
4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;pp
VP:                  ^ ,          R2,          p. R@OpVV8H  q'       gz   \        P                  ! R3V	3R8VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR+R V/,          p\        \        P                  ! V4      4      hR;p;p	pVP:                  ^ ,          R2,          p. RAOpVV8H  q'       gz   \        P                  ! R3V	3R8VV34      R\        P                  ! V4      R\        P                  ! V4      /,          pR+R V/,          p\        \        P                  ! V4      4      hR;p;p	pR# u upi )Br  r   rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   Atest_add_code_required_submit_code_succeeds.<locals>.__annotate__  r   r   c                  . ROq0V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;rCV\        8H  qD'       g   \         P                  ! RV3R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                  ! \        4      '       d   \         P
                  ! \        4      MR	/,          pR
RV/,          p\        \         P                  ! V4      4      hRp\        ^ \        P                  ! RR/4      R7      # r   r   r   s	   &$$      r   r  Ctest_add_code_required_submit_code_succeeds.<locals>.status_handler  r  r   r   c               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   r    s-     Z ZZ #Z
 
Zr   c                 < . ROq0V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q1VJ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;rC\        VR,          4      pVR	,          P                  \        P                  ! R
RR//4      RR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        S^ RR7      # )r*   r   rK   r   r   r   Nr   r  r  r  r  r  r0   r1   r  r  r  r  r  r  r  r  Fr  r  r   r   r   r  r   )	rK   r   r"  r  r   r  r   rM   r$  s	   &$,     r   r%  Btest_add_code_required_submit_code_succeeds.<locals>.login_handler  s`    dcccccccwccccccwccccwcccccccccccc$sss$#123
	)	)55JJ*<e)DEF 	6 	
 
m	#//JJ"&(:*I3U%  	0 	
 !SXYYr   r'  r*  r  r+  r:  r   r  r  rE  r   r   r6  r  r~  r;  r  r   r   r   r  r  r   r
   r.  code_prompt_textrf  r  r7  zRassert %(py6)s
{%(py6)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.session
}, %(py4)s)
}
isinstancer   z 1234 z1234
r<  r-  r/  r   r0  r1  r2  r  rK   r   r  r  r  )zq%(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.session
}.process
}.submitted_codes
} == %(py9)sr=  rs   r   r  r>  r?  r@  rA  r   r  )r    r8   r   r	   rB  r  r   r   r   r   r   r   r   r   r   r  r
   r  r  r   r   r^   r   rQ   r/  r%   r!   r#   r"   rA   ) r   rC  r  r  r%  r(  rD  	operationrE  r  r   rI  rH  r  rq  r  r   r   r   r   ro  rp  r  rL  rG  r  rF  r#  r  r/  r  r$  s    &                              @r   +test_add_code_required_submit_code_succeedsr    s	   h'HvL\
 !%	
Z &*Z Z6 ^$F&}5M#HWI]]>6I]JF<))	)	)))))))))))4))))4))))))))))))))<))))))	))))))))<11 11 111111111111411114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1LM0000000000000=0000=00000000000000 ,#4,!$  $     $     =   =        #4   #4   ,    !  !   $         $++@:+-?@@@@@@@@@@:@@@@:@@@@@@@m@@@@m@@@+@@@@@@-?@@@@-?@@@@@@@@@@-//:  F ((F(88FXJF8JFFFFF8JFFFFFF=FFFF=FFF FFF(FFF8FFFJFFFFFFFFVI$-.I5EJJI=.9+=.+=====.+===.===+========m##G7$7$77$<<)>)<>)))))<>))))))7))))7)))<)))>))))))))==...=......=.......7....7...=............*************7****7**************<< 5 <5     <5      7    7   <   5        <<?9%O)OO%)OOOOOO%)OOOO%OOO)OOOOOOOOOq!),  1 , 1    , 1   ,    1         /s   {>c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   =  s     ! !t ! !r   c                   \        V 4      pR R/R R llp\        V4      p\        WR7      P                  RRR7      p\	        V4      qUP
                  pRqvV8H  q'       Eg3   \        P                  ! RV3R Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\	        V4      qUP
                  pRqvV8H  q'       Eg3   \        P                  ! RV3R Wg3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      /,          p	RRV	/,          p
\        \        P                  ! V
4      4      hR;p;p;r\	        V4      pVP
                  pRqlV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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP                  pRqlVJ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      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rVP                  P                  P!                  4        \#        V4      pV Uu. uF  pVP
                  NK  	  ppRR.pVV8H  qU'       gz   \        P                  ! RV3R$VV34      R
\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;r]VR%,          pVP$                  pRpVVJqf'       g   \        P                  ! R"V3R&VV3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VP"                  q! 4       p. qV8H  pV'       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;ppR# u upi )(r   Nc               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   >test_add_code_required_cancel_rolls_back.<locals>.__annotate__@  s(     
 

 #

 

r   c                   . ROq0V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q1VJ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;rC\        R^ R	R
7      # )r*   r   rK   r   r   r   Nr   r  Fr  r   r   r   r   r  ry  )rK   r   r"  r  r   r  r   s   &$,    r   r%  ?test_add_code_required_cancel_rolls_back.<locals>.login_handler@  s     DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC$sss$ v 
 	
r   r|  	Cancelledr+  r:  r   r  r  rE  r   r   r6  r  r~  r;  r  r   r   r   rh  r  r   r-  r.  r  rC  r  rf  r   r  r  r   r  r=  rs   r  r  )r    r   r	   rB  r  r   r   r   r   r   r   r   r   r   r  r^   r   rQ   r  )r   rC  r%  rD  rE  r  r   rI  rH  r  rq  r  r   r   r   r   r  rF  r#  r  rG  ro  r  s   &                      r   (test_add_code_required_cancel_rolls_backr  =  s   h'H
 &*
 '}5M EII+bfIgF<))	)	)))))))))))4))))4))))))))))))))<))))))	))))))))<11 11 111111111111411114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1LM0000000000000=0000=00000000000000  ,,,,,,, ,,,,,,=,,,,=,,, ,,,,,,,,,,,!!++-VI$-.I5EJJII.:y2II.2IIIIII.2IIII.III2IIIIIIIIIR=*=*d*d*****d***=******d********== =? b b     ?      8    8   =   ?   b         /s   =]!c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   _  s      N NPT NY] Nr   c                B   \        V 4      pVP                  R R4      pRpVR,          P                  V4       VR,          P                  \        P
                  ! RRRRR	R
/4      RR7       VR,          P                  \        P
                  ! RRRRRRR
//4      RR7       VP                  4       ^ ,          pRR/R R llpRR/R R llp\        \        V\        V4      \        V4      R7      P                  V4      4      pV Uu. uF  qP                  NK  	  p	p. R,OqV
8H  q'       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	;rVR/,          P"                  pRqVJq'       g   \        P                  ! R0V3R1W3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*                  pRpVV8H  q'       g   \        P                  ! R-V
3R2VV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;p
pVP,                  pRpVV8H  q'       g   \        P                  ! R-V
3R3VV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;p
pVP.                  pR&pVV8H  q'       g   \        P                  ! R-V
3R4VV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;p
pRqV,          p\1        V4      pRRRRR	R&/pVV8H  pV'       Eg4   \        P                  ! R-V3R5VV34      RR'\$        P&                  ! 4       9   g!   \        P(                  ! \0        4      '       d   \        P                  ! \0        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      /,          pR*R+V/,          p\        \        P                   ! V4      4      hR;p;p;p;ppR# u upi )6rafaRafa   {"before":"credentials"}r  r3  r!   zrafa@example.comr4  r2  r5  zold-planr0   r1   r  r  r  r  r  rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   Wtest_reauthenticate_keeps_known_identity_and_updates_subscription.<locals>.__annotate__|  rV  r   c               H    \        ^ \        P                  ! RR/4      R7      # rX  rY  rZ  s   &$$r   r  Ytest_reauthenticate_keeps_known_identity_and_updates_subscription.<locals>.status_handler|  r\  r   r   c               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   r    -     R RR #R
 
Rr   c                  . ROq0V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q1VJ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;rC\        VR,          4      pVR	,          P                  \        P                  ! R
RR//4      RR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        R^ RR7      # )r*   r   rK   r   r   r   Nr   r  r  r  r  new-planr0   r1   r  r  r  zRAFA@example.comr  r`  r  r   Tr  r   r   r   r   r  r   rK   r   r"  r  r   r  r   rM   s   &$,     r   r%  Xtest_reauthenticate_keeps_known_identity_and_updates_subscription.<locals>.login_handler  sk    DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC$sss$#123
	)	)55JJ*<j)IJK 	6 	
 
m	#//JJ"&(:*I3Z%  	0 	
 !(mz{  MQ  R  	Rr   r'  r  r   r-  r.  r   	refreshedr   r   r   r   r   r   r  r6   claude_homerf  r  r7  r9  r   r=  rs   r   r  r?  r@  rA  z<%(py6)s
{%(py6)s = %(py0)s((%(py1)s / %(py3)s))
} == %(py9)s)r    rk  write_bytesr!  r3   r   rQ   r	   r8   r   reauthenticater   r   r   r   r   r   r/  r   r   r   r!   r#   r"   r6   )r   rC  r  original_credentialsr/  r  r%  rE  rF  r#  r   r  r  rG  r  r   r  r   r   r   ro  rp  rI  r  rL  s   &                        r   Atest_reauthenticate_keeps_known_identity_and_updates_subscriptionr  _  s   h'H""662K6&&334HI**66

+)#Z	
  7 	 = ,,

"$6&	/!	
  -  mmoa GR !%	RR &*R6 HW^-DRderRst  	D  	D  EL  	MF %++F5JJFX+/XX/XXXXXX+XXX+XXX/XXXXXXXXXr
""I  D     9      9    9   D        ??000?000000?0000000900009000?000000000000,9,9,,,,,9,,,,,,9,,,,9,,,,,,9,,,,,,,,>>'Z'>Z'''''>Z''''''9''''9'''>'''Z''''''''$; $;; :;< #)ZA < A    	< A   	  	:   	:   	  	k   	k   	$;   	<   	 A      	   ,s   	Zc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s$     @L @LPT @LY] @Lr   c                   \        V 4      pVP                  R R4      pVP                  RR4      pRpRpRpVR,          P                  V4       VR,          P                  V4       VR	,          P                  V4       VR,          P                  \        P
                  ! R
RRRRR/4      RR7       VP                  4       ^ ,          pVP                  4       ^,          pRR/R R llp	RR/R R llp
\        \        V\        V	4      \        V
4      R7      P                  V4      4      pV Uu. uF  qP                  NK  	  pp. R,OqV8H  q'       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;rVR/,          qP"                  qV8H  pV'       g   \        P                  ! R-V3R0W3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RpVV,          qP*                  pV! 4       pVV8H  pV'       Eg,   \        P                  ! R-V3R1VV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      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pRpVV,          qP*                  pV! 4       pVV8H  pV'       Eg,   \        P                  ! R-V3R1VV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      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pR	pVV,          qP*                  pV! 4       pVV8H  pV'       Eg,   \        P                  ! R-V3R1VV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      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pR# u upi )2r  r  royRoyr  sJ   {"email":"rafa@example.com","org_id":"org-rafa","subscription_type":"max"}sR   {"oauthAccount":{"emailAddress":"rafa@example.com","organizationUuid":"org-rafa"}}r  r3  r  r!   zroy@example.comr4  zorg-royr5  ra  r0   r1   rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   Wtest_reauthenticate_restores_original_files_on_identity_collision.<locals>.__annotate__  rV  r   c               H    \        ^ \        P                  ! RR/4      R7      # rX  rY  rZ  s   &$$r   r  Ytest_reauthenticate_restores_original_files_on_identity_collision.<locals>.status_handler  r\  r   r   c               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   r    s-     R RR #R
 
Rr   c                  . ROq0V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q1VJ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;rC\        VR,          4      pVR	,          P                  R
RR7       VR,          P                  RRR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        R^ RR7      # )r*   r   rK   r   r   r   Nr   r  r  z{"after":"credentials"}r0   r1   r3  z{"mutated":true}r  r  r  zROY@example.comr  zORG-ROYr  ra  r   Tr  r   r   r   r   r  r   r  s   &$,     r   r%  Xtest_reauthenticate_restores_original_files_on_identity_collision.<locals>.login_handler  sl    DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC$sss$#123
	)	)556OZa5b	-	-99:LW^9_	m	#//JJ"&(9*I3V%  	0 	
 !(mz{  MQ  R  	Rr   r'  r  r   r-  r.  r   r   otherr   r   r   current_homer   rf  r  r  r7  original_identityoriginal_metadatarg  r   r=  rs   rj  )zU%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = (%(py0)s / %(py2)s).read_bytes
}()
} == %(py9)s)r    rk  r  r!  r3   r   rQ   r	   r8   r   r  r   r   r   r   r   r   ri  r   r   r   
read_bytes)r   rC  r  
other_homer  r  r  currentr  r  r%  rE  rF  r#  r   r  r  rG  r   r   r   r   rH  rp  r  rL  s   &                         r   Atest_reauthenticate_restores_original_files_on_identity_collisionr    sh   h'H##FF3L!!%/J6em''445IJ++889JKM!../@A))55

*)#V	
  6 	 mmoa GMMOAER !%	RR &*R2 HW^-DRderRst  	D  	D  EL  	MF %++F5JJFf+/ff/ffffff+fff+fff/fffffffff":((5((((((((:(((((((((5((((5((((((((.TL..T::T:<T<@TTTTTT<@TTTTTTTLTTTTLTTT.TTT:TTT<TTTTTT@TTTTT@TTTTTTTTTT2UL22U>>U>@U@DUUUUUU@DUUUUUUULUUUULUUU2UUU>UUU@UUUUUUDUUUUUDUUUUUUUUUU(KL=(K44K46K6:KKKKKK6:KKKKKKKLKKKKLKKK=KKK4KKK6KKKKKK:KKKKK:KKKKKKKKKK	 ,s   0[ c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s      E E[_ Edh Er   c                   \        V 4      pVP                  R R4      pVR,          P                  RRR7       VR,          P                  \        P                  ! RRR	R
RRR//4      RR7       \        R RVR	RRR7      pRR/R R llpRR/R R llp\        \        V\        V4      \        V4      R7      P                  V4      4      pV Uu. uF  qwP                  NK  	  pp. R(OqV	8H  q'       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;rRqV
,          p\#        V4      pRR	RRRR /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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;p;ppR# u upi ),legacyLegacyr  r_  r0   r1   r  r  r  legacy@example.comr  
legacy-orgr  freezlegacy-account)r!   r"   r#   rH   Nc               (    V ^8  d   QhRRRRRRRR/# rJ   r   )r   s   "r   r   btest_reauthenticate_legacy_missing_identity_accepts_unique_verified_baseline.<locals>.__annotate__  rV  r   c               H    \        ^ \        P                  ! RR/4      R7      # rX  rY  rZ  s   &$$r   r  dtest_reauthenticate_legacy_missing_identity_accepts_unique_verified_baseline.<locals>.status_handler  r\  r   r   c               $    V ^8  d   QhRRRRRR/# r	  r   )r   s   "r   r   r    r  r   c                  . ROq0V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q1VJ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;rC\        VR,          4      pVR	,          P                  \        P                  ! R
RR//4      RR7       VR,          P                  \        P                  ! RRRRRRR//4      RR7       \        R^ RR7      # )r*   r   rK   r   r   r   Nr   r  r  r  r  ra  r0   r1   r  r  r  r  r  r  r  r   Tr  r   r   r   r   r  r   r  s   &$,     r   r%  ctest_reauthenticate_legacy_missing_identity_accepts_unique_verified_baseline.<locals>.login_handler  sk    DCCCCCCCwCCCCCCwCCCCwCCCCCCCCCCCC$sss$#123
	)	)55JJ*<f)EFG 	6 	
 
m	#//JJ"&(<*L3V%  	0 	
 !(mz{  MQ  R  	Rr   r'  r  r   r-  r.  r3  r!   r4  r5  ra  r   r6   r  r   rf  r  r7  r9  r   r=  r  )r    rk  r!  r3   r   r,   rQ   r	   r8   r   r  r   r   r   r   r   r   r6   r   r   r   )r   rC  r  legacy_accountr  r%  rE  rF  r#  r   r  r  rG  r   ro  rp  rI  r  rL  s   &                  r   Ltest_reauthenticate_legacy_missing_identity_accepts_unique_verified_baseliner    s   h'H""8X6K&&224'2J= ,,

"$8&/!	
  -  "#NR !%	RR &*R6 HW^-DRderRst  	D  	D  ES  	TF %++F5JJFX+/XX/XXXXXX+XXX+XXX/XXXXXXXXX$; $;; :;< %,VA  A    	<   	  	:   	:   	  	k   	k   	$;   	<   	 A      	   ,s   K)6
__future__r   builtinsr   _pytest.assertion.rewrite	assertionrewriter   r3   r   sysr   r  collections.abcr   pathlibr   pytestr.   insertr&   __file__resolveparentsaccount_registryr   r   r   r   claude_auth_operationr	   r
   r   r   r   r    r,   r6   r8   r[   ru   r   r   rO  rr  r  r  r  r  r  r  r  r  r  r   r   r   <module>r"     s   "     
   $   3tH~--/77:; < V V 
   "&8N N,  "> >B#
 #
LMG`?>D;,%:P GFG>Qh!DNb@LFEr   