+
    5mjY  c                      ^ RI Ht ^ RIt^ RIHu Ht ^ RIt^ RI	H
t
 ^ RIt^ RIt]P                  R R l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tR R ltR R ltR# )    )annotationsN)Pathc               $    V ^8  d   QhRRRRRR/# )   tmp_pathr   monkeypatchpytest.MonkeyPatchreturntuple[Path, Path] )formats   "p/home/user/overdeck-private-tests/workstation-ai-broad2/modules/systray/tests/test_retire_runtime_compat_link.py__annotate__r      s#      d 1C HY     c                    V R ,          pVP                  4        V R,          pVP                  V4       VP                  R\        V4      4       VP                  R\        V4      4       W23# )runtimez.systray-aiSYSTRAY_RUNTIME_DIRSYSTRAY_RUNTIME_COMPAT_LINK)mkdir
symlink_tosetenvstr)r   r   targetlinks   &&  r   link_and_targetr      s]    	!F
LLNm#DOOF,c&k:4c$i@<r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   cmdlineszdict[int, str]r	   r   )r   s   "r   r   r      s!        D r   c                H   V R ,          pVP                  4        VR,          P                  4        VP                  4        F]  w  r4V\        V4      ,          pVP                  4        VR,          P                  VP	                  RR4      P                  4       4       K_  	  V# )procz	not-a-pidcmdline  )r   itemsr   write_bytesreplaceencode)r   r   rootpidr   entrys   &&    r   
_proc_rootr)      s}    fDJJL	K  (s3x		''T(B(I(I(KL ) Kr   c               $    V ^8  d   QhRRRRRR/# r   r   r
   r   r   r	   Noner   )r   s   "r   r   r   !   s$     ! !&!26!	!r   c           	     r  a V w  r#. o\         P                  ! \        VR R/4      V3R lR7      pRqTV8H  qf'       g   \        P                  ! RV3RWE34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;reVP                  qf! 4       q'       * q'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          p\        \        P                  ! V4      4      hR
;p;rVP                  qf! 4       q'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          p\        \        P                  ! V4      4      hR
;riR.pSV8H  qf'       g   \        P                  ! RV3RSV34      RR\
        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;reR
# )  z/usr/bin/python3 unrelated.pyc                 &   < S P                  R 4      # disabledappendcallss   r   <lambda>Btest_retires_the_link_when_nothing_references_it.<locals>.<lambda>(   s    ell:6r   	proc_rootdisable_timerretiredpy0resultpy3assert %(py5)spy5NzEassert not %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exists
}()
}r   py2py4zAassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.is_dir
}()
}r   r1   r5   ==z%(py0)s == %(py3)s)
retire_modretirer)   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationexistsis_dir)r   r   r   r   r=   @py_assert2@py_assert1@py_format4@py_format6@py_assert3@py_assert5@py_format5r5   s   &&          @r   0test_retires_the_link_when_nothing_references_itrY   !   s    #LDEX.M'NO6F Y666Y{{{}tt{}===??66=?L 5L     5L      5    5   L        r   c               $    V ^8  d   QhRRRRRR/# r+   r   )r   s   "r   r   r   0   s$     	 	&	26			r   c           	       a V w  r#. o\        VR RV R2/4      p\        P                  ! VV3R lR7      pRqeV8H  qw'       g   \        P                  ! RV3RWV34      RR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pR	R
V/,          p	\        \        P                  ! V	4      4      hR;rvVP                  qw! 4       q'       g   RRR\
        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V
4      /,          p\        \        P                  ! V4      4      hR;rz. pSV8H  qw'       g   \        P                  ! RV3RSV34      RR\
        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          pR	R
V/,          p	\        \        P                  ! V	4      4      hR;rvR# )r.   zclaude --settings z/settings.jsonc                 &   < S P                  R 4      # r0   r2   r4   s   r   r6   Dtest_keeps_the_link_while_a_process_still_names_it.<locals>.<lambda>6   s    %,,WaJbr   r8   held:1r<   r=   r>   r?   r@   NEassert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.is_symlink
}()
}r   rA   rB   r5   rC   rE   )r)   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   
is_symlink)r   r   r   _r9   r=   rR   rS   rT   rU   rV   rX   r5   s   &&          @r   2test_keeps_the_link_while_a_process_still_names_itrb   0   s^    GDE8d.@n,U%VWIBbcFX666X???44?5B;5B55Br   c               $    V ^8  d   QhRRRRRR/# r+   r   )r   s   "r   r   r   <   s(     [ [2C [t [X\ [r   c                J   V w  r#\        V\        P                  ! 4       R V 2/4      p\        P                  pR qe! WFR7      pRqV8H  q'       EgI   \
        P                  ! RV	3RWx34      RR\        P                  ! 4       9   g!   \
        P                  ! \        4      '       d   \
        P                  ! \        4      MRR\
        P                  ! V4      RR\        P                  ! 4       9   g   \
        P                  ! V4      '       d   \
        P                  ! V4      MRR	\
        P                  ! V4      R
\
        P                  ! V4      R\
        P                  ! V4      /,          p
RRV
/,          p\        \
        P                  ! V4      4      hR;p;p;p;rR# )zpython3 retire c                     R # Nr   r   r   r   r6   .test_ignores_its_own_process.<locals>.<lambda>?   s    r   r8   r;   r<   rF   rA   r>   r9   r@   py7py10zassert %(py12)spy12NrC   )zn%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.retire
}(proc_root=%(py3)s, disable_timer=%(py5)s)
} == %(py10)s)r)   osgetpidrF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   )r   r   r   ra   r9   rS   @py_assert4@py_assert6@py_assert9@py_assert8@py_format11@py_format13s   &&          r   test_ignores_its_own_processrs   <   s    GD8biik_TF3K%LMIZZyMZQZZQZZZZZZMZZZZZZ:ZZZZ:ZZZZZZZZZyZZZZyZZZZZZMZZZQZZZZZZZZZZr   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r
   r   r   r   r   r	   r,   r   )r   s   "r   r   r   B   s,      &26EW	r   c           	     H  a V w  r4VR ,          pVP                  4        VP                  R\        V4      4       . o\        P                  ! \        V/ 4      V3R lR7      pRqvV8H  q'       g   \        P                  ! RV3RWg34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          p	RR	V	/,          p
\        \        P                  ! V
4      4      hR
;rVP                  q! 4       q'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V4      /,          p\        \        P                  ! V4      4      hR
;r. pSV8H  q'       g   \        P                  ! RV3RSV34      RR\        P                  ! 4       9   g   \        P                  ! S4      '       d   \        P                  ! S4      MRR\        P                  ! V4      /,          p	RR	V	/,          p
\        \        P                  ! V
4      4      hR
;rR
# )	elsewherer   c                 &   < S P                  R 4      # r0   r2   r4   s   r   r6   Btest_leaves_a_link_pointing_somewhere_else_alone.<locals>.<lambda>K       %,,zBZr   r8   zforeign-targetr<   r=   r>   r?   r@   Nr_   r   rA   rB   r5   rC   rE   )r   r   r   rF   rG   r)   rH   rI   rJ   rK   rL   rM   rN   rO   r`   )r   r   r   r   ra   rv   r=   rR   rS   rT   rU   rV   rX   r5   s   &&&          @r   0test_leaves_a_link_pointing_somewhere_else_alonerz   B   sz    GD;&IOO,c)n=EXr*:ZF &%%%%%%%6%%%%%%6%%%%6%%%%%%%%%%%%???44?5B;5B55Br   c               $    V ^8  d   QhRRRRRR/# r+   r   )r   s   "r   r   r   R   s$     
! 
!&
!26
!	
!r   c                  a	 V w  r#VP                  4        . o	\        P                  ! \        V/ 4      V	3R  lR7      pRqTV8H  qf'       g   \        P
                  ! RV3RWE34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reR	.pS	V8H  qf'       g   \        P
                  ! RV3RS	V34      RR
\        P                  ! 4       9   g   \        P                  ! S	4      '       d   \        P                  ! S	4      MR
R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;reR# )c                 &   < S P                  R 4      # r0   r2   r4   s   r   r6   Ntest_reports_absent_and_stops_the_timer_when_already_retired.<locals>.<lambda>Y   ry   r   r8   absentr<   r=   r>   r?   r@   Nr1   r5   rC   rE   )unlinkrF   rG   r)   rH   rI   rJ   rK   rL   rM   rN   rO   )
r   r   r   ra   r=   rR   rS   rT   rU   r5   s
   &&       @r   <test_reports_absent_and_stops_the_timer_when_already_retiredr   R   s     GDKKMEXr*:ZF X666XL 5L     5L      5    5   L        r   c               $    V ^8  d   QhRRRRRR/# r+   r   )r   s   "r   r   r   _   s$      &26	r   c           	     J   V w  r#\         P                  ! VR ,          R R7      pRqTV8H  qf'       g   \        P                  ! RV3RWE34      RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR	;reVP                  qf! 4       q'       g   R
RR\        P
                  ! 4       9   g   \        P                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      R\        P                  ! V	4      /,          p
\        \        P                  ! V
4      4      hR	;riR	# )zmissing-procc                     R # rf   r   r   r   r   r6   9test_unreadable_proc_is_treated_as_held.<locals>.<lambda>c   s    Z^r   r8   r^   r<   r=   r>   r?   r@   Nr_   r   rA   rB   rC   rE   )rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   r`   )r   r   r   ra   r=   rR   rS   rT   rU   rV   rX   s   &&         r   'test_unreadable_proc_is_treated_as_heldr   _   s     GDN)BR^_FX666X???44?r   c                   V ^8  d   QhRR/# )r   r	   r,   r   )r   s   "r   r   r   h   s     5 5T 5r   c                 \   \         P                  p R R.q! V4      p^q2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P
                  ! 4       9   g!   \        P                  ! \         4      '       d   \        P                  ! \         4      MRR\        P                  ! V 4      R\        P                  ! V4      R\        P                  ! V4      R\        P                  ! V4      /,          pRR	V/,          p\        \        P                  ! V4      4      hR
;p ;p;p;rCR
# )rG   z--nowr<   rF   rA   rB   py6py9zassert %(py11)spy11NrC   )zJ%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.main
}(%(py4)s)
} == %(py9)s)
rF   mainrH   rI   rJ   rK   rL   rM   rN   rO   )rS   rV   rW   rp   @py_assert7@py_format10@py_format12s          r   test_main_rejects_argumentsr   h   s    ??4Hg.4?./414144444/444444:4444:444?444.444/4441444444444r   )
__future__r   builtinsrJ   _pytest.assertion.rewrite	assertionrewriterH   rk   pathlibr   pytestretire_runtime_compat_linkrF   fixturer   r)   rY   rb   rs   rz   r   r   r   r   r   r   <module>r      sY    "   	   /  !	[ 
!5r   