+
    Bi-                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIt^ RIt ! R R]P                  4      t ! R R4      t ! R R]]P                  4      t] P"                  ]P$                  ! 4       3R	 l4       t ! R
 R]]P                  4      tR]P$                  ! 4       ,           t ! R R]]P                  4      t ! R R]]P                  4      t]R8X  d   ]P2                  ! 4        R# R# )    N)Pathc                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )TestPackagesc                x    \         P                  P                  W4      p\        VR 4      P	                  4        R# )wbN)ospathjoinopenclose)self	directoryfilenamefullnames   &&& */usr/lib/python3.14/test/test_ensurepip.pytouchTestPackages.touch   s'    77<<	4Xt""$    c           	        \         P                  ! 4       ;_uu_ 4       pV P                  VR 4       \        P                  P
                  P                  \        R\        V4      4      ;_uu_ 4        V P                  \        P                  ! 4       R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z pip-1.2.3b1-py2.py3-none-any.whl_WHEEL_PKG_DIRz1.2.3b1N)tempfileTemporaryDirectoryr   unittestmockpatchobject	ensurepipr   assertEqualversion)r   tmpdirs   & r   test_versionTestPackages.test_version   s    ((**fJJvAB$$++I7GfVV  !2!2!4i@ W +*VV +**s$   AB<1&B)	B<)B94B<<C	c                   \         P                  P                  P                  \        R R4      ;_uu_ 4        V P                  \        P                  \        P                  ! 4       4       RRR4       R#   + '       g   i     R# ; i)r   N)r   r   r   r   r   r   _PIP_VERSIONr   r   s   &r   test_version_no_dir TestPackages.test_version_no_dir   sQ    ]]  ''	3CTJJY33Y5F5F5HI KJJJs   4A66B	c           	     ~   R \         P                   R2p\        P                  P                  P                  \         RR4      ;_uu_ 4        \         P                  ! 4       ;_uu_ 4       pV P                  WP                  4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zpip-z-py3-none-any.whlr   N)	r   r$   r   r   r   r   _get_pip_whl_path_ctxr   name)r   pip_filenamebundled_wheel_paths   &  r   test_selected_wheel_path_no_dir,TestPackages.test_selected_wheel_path_no_dir!   s    i4455FG]]  ''	3CTJJ00226H  /F/FG 3 KJ22 KJJs$   B+*B	B+B(#B++B<	c                l   R p\         P                  ! 4       ;_uu_ 4       pV P                  W!4       V P                  VR4       V P                  VR4       V P                  VR4       \        P                  P
                  P                  \        R\        V4      4      ;_uu_ 4        \        P                  ! 4       ;_uu_ 4       pV P                  WP                  4       RRR4       RRR4       RRR4       R#   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R# ; i)zpip-20.2.2-py2.py3-none-any.whlzpip-1.2.3-py2.py3-none-any.whlz!wheel-0.34.2-py2.py3-none-any.whlzpip-script.pyr   N)r   r   r   r   r   r   r   r   r   r)   r   r*   )r   r+   r    r,   s   &   r   !test_selected_wheel_path_with_dir.TestPackages.test_selected_wheel_path_with_dir'   s    8((**fJJv,JJv?@JJvBCJJv/$$++I7GfVV4466:L$$\3J3JK 7 W +* 76 WV +**s<   BD"(D	C<"D	*D"<DD	DD""D3	 N)__name__
__module____qualname____firstlineno__r   r!   r&   r-   r0   __static_attributes____classdictcell____classdict__s   @r   r   r      s(     %AJHL Lr   r   c                   &   a  ] tR t^7t o R tRtV tR# )EnsurepipMixinc                .   \         P                  P                  R 4      pVP                  4       V n        ^ V P                  n        V P                  VP                  4       \        P                  p\         P                  P                  R4      pVP                  4       p\        P                  Vn
        V P                  VP                  4       W$n	        \        P                  Vn        \        P                  P                  4       ;V n        Vn        R# )zensurepip._run_pipzensurepip.osN)r   r   r   startrun_pipreturn_value
addCleanupstopr   devnulllistdirr	   environcopy
os_environ)r   run_pip_patchreal_devnullos_patch
patched_oss   &    r   setUpEnsurepipMixin.setUp9   s     ++,@A$**,$%!**+ zz==&&~6^^%
ZZ
&)''
/1zz/@@*,r   )rG   r?   N)r3   r4   r5   r6   rL   r7   r8   r9   s   @r   r<   r<   7   s     A Ar   r<   c                   n   a  ] tR t^Kt o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )TestBootstrapc                R   \         P                  ! 4        V P                  P                  R RRR\        P
                  P                  R.\        P
                  P                  4       V P                  P                  ^ ,          ^,          pV P                  \        V4      ^4       R# install--no-cache-dir
--no-index--find-linkspipN)
r   	bootstrapr?   assert_called_once_withr   r   ANY	call_argsr   len)r   additional_pathss   & r   test_basic_bootstrapping&TestBootstrap.test_basic_bootstrappingM   s    ,,+\>!!5 MM	
  <<11!4Q7-.2r   c           
         \         P                  ! R R7       V P                  P                  RRRR\        P
                  P                  RR R.\        P
                  P                  4       R# )	z	/foo/bar/)rootrR   rS   rT   rU   z--rootrV   Nr   rW   r?   rX   r   r   rY   r%   s   &r   test_bootstrapping_with_root*TestBootstrap.test_bootstrapping_with_root[   sT    -,,+\>!!8[
 MM	
r   c           	         \         P                  ! R R7       V P                  P                  RRRR\        P
                  P                  RR.\        P
                  P                  4       R# )	T)userrR   rS   rT   rU   z--userrV   Nra   r%   s   &r   test_bootstrapping_with_user*TestBootstrap.test_bootstrapping_with_userg   sQ    &,,+\>!!8U MM	
r   c           	         \         P                  ! R R7       V P                  P                  RRRR\        P
                  P                  RR.\        P
                  P                  4       R# )	T)upgraderR   rS   rT   rU   z	--upgraderV   Nra   r%   s   &r   test_bootstrapping_with_upgrade-TestBootstrap.test_bootstrapping_with_upgrader   sQ    D),,+\>!!; MM	
r   c           	         \         P                  ! ^R7       V P                  P                  RRRR\        P
                  P                  RR.\        P
                  P                  4       R# )	   	verbosityrR   rS   rT   rU   -vrV   Nra   r%   s   &r   #test_bootstrapping_with_verbosity_11TestBootstrap.test_bootstrapping_with_verbosity_1}   sQ    a(,,+\>!!4 MM	
r   c           	         \         P                  ! ^R7       V P                  P                  RRRR\        P
                  P                  RR.\        P
                  P                  4       R# )	   rn   rR   rS   rT   rU   -vvrV   Nra   r%   s   &r   #test_bootstrapping_with_verbosity_21TestBootstrap.test_bootstrapping_with_verbosity_2   sQ    a(,,+\>!!5% MM	
r   c           	         \         P                  ! ^R7       V P                  P                  RRRR\        P
                  P                  RR.\        P
                  P                  4       R# )	   rn   rR   rS   rT   rU   -vvvrV   Nra   r%   s   &r   #test_bootstrapping_with_verbosity_31TestBootstrap.test_bootstrapping_with_verbosity_3   sQ    a(,,+\>!!65 MM	
r   c                v    \         P                  ! 4        V P                  V P                  R ,          R4       R# )ENSUREPIP_OPTIONSrR   Nr   rW   r   rG   r%   s   &r   'test_bootstrapping_with_regular_install5TestBootstrap.test_bootstrapping_with_regular_install   s(    )<=yIr   c                z    \         P                  ! R R7       V P                  V P                  R,          R4       R# )T)
altinstallr~   r   Nr   r%   s   &r   #test_bootstrapping_with_alt_install1TestBootstrap.test_bootstrapping_with_alt_install   s*    t,)<=|Lr   c                l    \         P                  ! R R7       V P                  RV P                  4       R# )T)default_pipr~   N)r   rW   assertNotInrG   r%   s   &r   #test_bootstrapping_with_default_pip1TestBootstrap.test_bootstrapping_with_default_pip   s%    -,doo>r   c                    V P                  \        4      ;_uu_ 4        \        P                  ! R R R7       RRR4       V P	                  V P
                  P                  4       R#   + '       g   i     L7; i)T)r   r   N)assertRaises
ValueErrorr   rW   assertFalser?   calledr%   s   &r   $test_altinstall_default_pip_conflict2TestBootstrap.test_altinstall_default_pip_conflict   sI    z**4TB +,,- +*s   A&&A6	c                    R V P                   R&   \        P                  ! 4        V P                  RV P                   4       R# ztest fodderPIP_THIS_SHOULD_GO_AWAYN)rG   r   rW   r   r%   s   &r   &test_pip_environment_variables_removed4TestBootstrap.test_pip_environment_variables_removed   s5     6C122DOODr   c                    \         P                  ! 4        V P                  V P                  R ,          \        P
                  4       R# )PIP_CONFIG_FILEN)r   rW   r   rG   r   rC   r%   s   &r   test_pip_config_file_disabled+TestBootstrap.test_pip_config_file_disabled   s.     	):;RZZHr   r2   N)r3   r4   r5   r6   r]   rb   rf   rj   rq   rv   r{   r   r   r   r   r   r   r7   r8   r9   s   @r   rO   rO   K   sP     3

	
	
	
	
	
JM?.
EI Ir   rO   c              #   ~  a "   S f   R pM ! V 3R lR4      pV! 4       p\        4       p\        P                  P                  RV4      pV\        P                  R&    Vx  WCJ d   \        P                  R R # V\        P                  R&   R #   YCJ d   \        P                  R i T\        P                  R&   i ; i5i)Nc                      < ] tR t^t Z tRtR# )fake_pip.<locals>.FakePipr2   N)r3   r4   r5   r6   __version__r7   )r   s   r   FakePipr      s    !Kr   r   rV   )r   sysmodulesget)r   rV   r   sentinelorig_pips   f    r   fake_pipr      s     	" 	"ixH{{uh/HCKK*	E"!)CKK E"!)CKKs   AB=B !-B=,B::B=c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )TestUninstallc                    \        R 4      ;_uu_ 4        \        P                  ! 4        R R R 4       V P                  V P                  P
                  4       R #   + '       g   i     L7; i)N)r   r   _uninstall_helperr   r?   r   r%   s   &r   )test_uninstall_skipped_when_not_installed7TestUninstall.test_uninstall_skipped_when_not_installed   s<    d^^'') ,,- ^s   AA)	c           	        \        R 4      ;_uu_ 4        \        P                  P                  4       ;_uu_ 4       p\        P
                  ! 4        RRR4       RRR4       XP                  4       P                  4       pV P                  RV4       V P                  V P                  P                  4       R#   + '       g   i     Lo; i  + '       g   i     Lz; i)znot a valid versionNz!only uninstall a matching version)r   testsupportcaptured_stderrr   r   getvaluestripassertInr   r?   r   )r   stderrwarnings   &  r   5test_uninstall_skipped_with_warning_for_wrong_versionCTestUninstall.test_uninstall_skipped_with_warning_for_wrong_version   s    +,,--//6++- 0 - //#))+97C,,-	 0/ -,s"   'CB8	C8CCC	c                    \        4       ;_uu_ 4        \        P                  ! 4        R R R 4       V P                  P	                  . RO4       R #   + '       g   i     L/; iN)	uninstall-y--disable-pip-version-checkrV   r   r   r   r?   rX   r%   s   &r   test_uninstallTestUninstall.test_uninstall   s;    ZZ'')  	,,	
 Zs   AA 	c                    \        4       ;_uu_ 4        \        P                  ! ^R7       RRR4       V P                  P	                  . RO4       R#   + '       g   i     L/; i)rm   rn   N)r   r   r   rp   rV   r   r%   s   &r   test_uninstall_with_verbosity_1-TestUninstall.test_uninstall_with_verbosity_1   =    ZZ''!4  	,,	
 Z   AA"	c                    \        4       ;_uu_ 4        \        P                  ! ^R7       RRR4       V P                  P	                  . RO4       R#   + '       g   i     L/; i)rt   rn   N)r   r   r   ru   rV   r   r%   s   &r   test_uninstall_with_verbosity_2-TestUninstall.test_uninstall_with_verbosity_2   r   r   c                    \        4       ;_uu_ 4        \        P                  ! ^R7       RRR4       V P                  P	                  . RO4       R#   + '       g   i     L/; i)ry   rn   N)r   r   r   rz   rV   r   r%   s   &r   test_uninstall_with_verbosity_3-TestUninstall.test_uninstall_with_verbosity_3   s=    ZZ''!4  	,,	
 Zr   c                    R V P                   R&   \        4       ;_uu_ 4        \        P                  ! 4        RRR4       V P	                  RV P                   4       R#   + '       g   i     L.; ir   )rG   r   r   r   r   r%   s   &r   r   4TestUninstall.test_pip_environment_variables_removed  sI     6C12ZZ'') 2DOOD Zs   AA.	c                    \        4       ;_uu_ 4        \        P                  ! 4        R R R 4       V P                  V P                  R,          \
        P                  4       R #   + '       g   i     LC; i)Nr   )r   r   r   r   rG   r   rC   r%   s   &r   r   +TestUninstall.test_pip_config_file_disabled  sB     ZZ'') ):;RZZH Zs   A$$A4	r2   N)r3   r4   r5   r6   r   r   r   r   r   r   r   r   r7   r8   r9   s   @r   r   r      s5     .
.


	
EI Ir   r   zpip c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestBootstrappingMainFunctioni  c           	        \         P                  P                  4       ;_uu_ 4       pV P                  \        4      ;_uu_ 4        \
        P                  ! R .4       RRR4       RRR4       XP                  4       P                  4       pV P                  V\        4       V P                  V P                  P                  4       R#   + '       g   i     Ls; i  + '       g   i     L~; iz	--versionN)r   r   captured_stdoutr   
SystemExitr   _mainr   r   r   EXPECTED_VERSION_OUTPUTr   r?   r   r   stdoutresults   &  r   test_bootstrap_version4TestBootstrappingMainFunction.test_bootstrap_version  s    \\))++v"":... / , "((*!89,,-	 /. ,+s#   CC	CCCC+	c                x   \         P                  ! . 4      pV P                  P                  R RRR\        P
                  P                  R.\        P
                  P                  4       V P                  P                  ^ ,          ^,          pV P                  \        V4      ^4       V P                  V^ 4       R# rQ   )
r   r   r?   rX   r   r   rY   rZ   r   r[   )r   	exit_coder\   s   &  r   r]   6TestBootstrappingMainFunction.test_basic_bootstrapping&  s    OOB'	,,+\>!!5 MM	
  <<11!4Q7-.2A&r   c                x    ^V P                   n        \        P                  ! . 4      pV P	                  V^4       R# rt   N)r?   r@   r   r   r   r   r   s   & r   test_bootstrapping_error_code;TestBootstrappingMainFunction.test_bootstrapping_error_code5  s,    $%!OOB'	A&r   r2   N)	r3   r4   r5   r6   r   r]   r   r7   r8   r9   s   @r   r   r     s     .'' 'r   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestUninstallationMainFunctioni;  c           	        \         P                  P                  4       ;_uu_ 4       pV P                  \        4      ;_uu_ 4        \
        P                  P                  R .4       RRR4       RRR4       XP                  4       P                  4       pV P                  V\        4       V P                  V P                  P                  4       R#   + '       g   i     Ls; i  + '       g   i     L~; ir   )r   r   r   r   r   r   
_uninstallr   r   r   r   r   r   r?   r   r   s   &  r   test_uninstall_version5TestUninstallationMainFunction.test_uninstall_version=  s    \\))++v"":..$$**K=9 / , "((*!89,,-	 /. ,+s#   C$!C	&C$C!C$$C4	c                    \        4       ;_uu_ 4        \        P                  P                  . 4      pR R R 4       V P                  P                  . RO4       V P                  X^ 4       R #   + '       g   i     LA; ir   )r   r   r   r   r?   rX   r   r   s   & r   test_basic_uninstall3TestUninstallationMainFunction.test_basic_uninstallE  sW    ZZ!,,2226I  	,,	
 	A& Zs    A,,A<	c                    \        4       ;_uu_ 4        ^V P                  n        \        P                  P                  . 4      pRRR4       V P                  X^4       R#   + '       g   i     L$; ir   )r   r?   r@   r   r   r   r   r   s   & r   test_uninstall_error_code8TestUninstallationMainFunction.test_uninstall_error_codeQ  sJ    ZZ()DLL%!,,2226I  	A& Zs   1A  A0	r2   N)	r3   r4   r5   r6   r   r   r   r7   r8   r9   s   @r   r   r   ;  s     .
'' 'r   r   __main__)
contextlibr   os.pathr   r   test.supportr   r   unittest.mockpathlibr   r   ensurepip._uninstallTestCaser   r<   rO   contextmanagerr   r   r   r   r   r   r3   mainr2   r   r   <module>r      s     	  
       %L8$$ %LPA A(oINH$5$5 oIb &&( * *$FINH$5$5 FIV !9#4#4#66 'NH4E4E '>'^X5F5F ': zMMO r   