Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_ensurepip.cpython-312.pyc

�

'Μg�-����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z	Gd�dej�ZGd�d�Z
Gd�de
ej�Zeje	j �fd��ZGd	�d
e
ej�Zde	j �zZGd�d
e
ej�ZGd�de
ej�Zedk(rej.�yy)�Nc�$�eZdZd�Zd�Zd�Zd�Zy)�TestPackagesc�x�tjj||�}t|d�j	�y)N�wb)�os�path�join�open�close)�self�	directory�filename�fullnames    �0/usr/local/lib/python3.12/test/test_ensurepip.py�touchzTestPackages.touchs)���7�7�<�<�	�8�4���X�t��"�"�$�c���tj�5}|j|d�tjj
j
tdd�5tjj
j
td|�5|jtj�d�ddd�ddd�ddd�y#1swY�xYw#1swY�xYw#1swYyxYw)Nz pip-1.2.3b1-py2.py3-none-any.whl�	_PACKAGES�_WHEEL_PKG_DIRz1.2.3b1)
�tempfile�TemporaryDirectoryr�unittest�mock�patch�object�	ensurepip�assertEqual�version)r�tmpdirs  r�test_versionzTestPackages.test_versions���
�
(�
(�
*�f��J�J�v�A�B��-�-�%�%�,�,�Y��T�J��-�-�%�%�,�,�Y�8H�&�Q�� � ��!2�!2�!4�i�@�R�K�+�
*�R�Q��K�J��+�
*�s<�AC�0C�%C�,C�4C�C�
C�C	�C�C&c���tjjjtdd�5tjjjtdd�5t	j
�}|j
tjt	j��ddd�ddd�|jdj�y#1swY�0xYw#1swY�4xYw)Nrr�pip)rrrrr�
_get_packagesr�_PIP_VERSIONr�assertIsNotNone�
wheel_name)r�packagess  r�test_get_packages_no_dirz%TestPackages.test_get_packages_no_dirs����m�m�!�!�(�(��K��F��m�m�!�!�(�(��4D�d�K� �.�.�0�H�
���Y�3�3�Y�5F�5F�5H�I�	L�G�	
���X�e�_�7�7�8�L�K��G�F�s$�0C"� AC�'C"�C	�C"�"C+c���d}tj�5}|j||�|j|d�tjj
j
tdd�5tjj
j
td|�5tj�}ddd�ddd�|jdjd�|j|djtjj||��|jt|�dg�ddd�y#1swY��xYw#1swY��xYw#1swYyxYw)Nzpip-20.2.2-py2.py3-none-any.whlz!wheel-0.34.2-py2.py3-none-any.whlrrr"z20.2.2)rrrrrrrrr#rr�
wheel_pathrrr	�sorted)r�pip_filenamerr's    r�test_get_packages_with_dirz'TestPackages.test_get_packages_with_dir's��8��
�
(�
(�
*�f��J�J�v�|�,��J�J�v�B�C��-�-�%�%�,�,�Y��T�J��-�-�%�%�,�,�Y�8H�&�Q�$�2�2�4��R�K�
���X�e�_�4�4�h�?����X�e�_�7�7��W�W�\�\�&�,�?�
A�
���V�H�-��w�7�+�
*�R�Q��K�J��+�
*�s=�AE�+0E
�E�0E
�8BE�E
�E
�
E	�E�E"N)�__name__�
__module__�__qualname__rr r(r-�rrrrs��%�A�
9�8rrc��eZdZd�Zy)�EnsurepipMixinc�.�tjjd�}|j�|_d|j_|j
|j�tj}tjjd�}|j�}tj|_
|j
|j�||_	tj|_tjj�x|_|_y)Nzensurepip._run_piprzensurepip.os)rrr�start�run_pip�return_value�
addCleanup�stopr�devnull�listdirr�environ�copy�
os_environ)r�
run_pip_patch�real_devnull�os_patch�
patched_oss     r�setUpzEnsurepipMixin.setUp>s��� �
�
�+�+�,@�A�
�$�*�*�,���$%����!����
�*�*�+��z�z���=�=�&�&�~�6���^�^�%�
��Z�Z�
������
�
�&�)�
���'�'�
��/1�z�z���/@�@���*�,rN)r.r/r0rCr1rrr3r3<s��Arr3c�Z�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zy)�
TestBootstrapc�>�tj�|jjddddtj
jdgtj
j�|jjdd}|jt|�d�y�N�install�--no-cache-dir�
--no-index�--find-linksr"r�)
r�	bootstrapr6�assert_called_once_withrr�ANY�	call_argsr�len)r�additional_pathss  r�test_basic_bootstrappingz&TestBootstrap.test_basic_bootstrappingRs���������,�,��+�\�>��
�
�!�!�5�
�
�M�M���	
� �<�<�1�1�!�4�Q�7������-�.��2rc
���tjd��|jjddddtj
jdddgtj
j�y)	Nz	/foo/bar/)�rootrHrIrJrKz--rootr"�rrMr6rNrrrO�rs r�test_bootstrapping_with_rootz*TestBootstrap.test_bootstrapping_with_root`sT������-����,�,��+�\�>��
�
�!�!�8�[��
�

�M�M���
	
rc	���tjd��|jjddddtj
jddgtj
j�y)	NT)�userrHrIrJrKz--userr"rVrWs r�test_bootstrapping_with_userz*TestBootstrap.test_bootstrapping_with_userlsQ������&����,�,��+�\�>��
�
�!�!�8�U�
�
�M�M���	
rc	���tjd��|jjddddtj
jddgtj
j�y)	NT)�upgraderHrIrJrKz	--upgrader"rVrWs r�test_bootstrapping_with_upgradez-TestBootstrap.test_bootstrapping_with_upgradewsQ�����D�)����,�,��+�\�>��
�
�!�!�;��
�
�M�M���	
rc	���tjd��|jjddddtj
jddgtj
j�y)	NrL��	verbosityrHrIrJrK�-vr"rVrWs r�#test_bootstrapping_with_verbosity_1z1TestBootstrap.test_bootstrapping_with_verbosity_1�sQ�����a�(����,�,��+�\�>��
�
�!�!�4��
�
�M�M���	
rc	���tjd��|jjddddtj
jddgtj
j�y)	N�r`rHrIrJrK�-vvr"rVrWs r�#test_bootstrapping_with_verbosity_2z1TestBootstrap.test_bootstrapping_with_verbosity_2�sQ�����a�(����,�,��+�\�>��
�
�!�!�5�%�
�
�M�M���	
rc	���tjd��|jjddddtj
jddgtj
j�y)	N�r`rHrIrJrK�-vvvr"rVrWs r�#test_bootstrapping_with_verbosity_3z1TestBootstrap.test_bootstrapping_with_verbosity_3�sQ�����a�(����,�,��+�\�>��
�
�!�!�6�5�
�
�M�M���	
rc�j�tj�|j|jdd�y)N�ENSUREPIP_OPTIONSrH�rrMrr>rWs r�'test_bootstrapping_with_regular_installz5TestBootstrap.test_bootstrapping_with_regular_install�s(������������)<�=�y�Irc�n�tjd��|j|jdd�y)NT)�
altinstallrmrqrnrWs r�#test_bootstrapping_with_alt_installz1TestBootstrap.test_bootstrapping_with_alt_install�s*�����t�,�������)<�=�|�Lrc�h�tjd��|jd|j�y)NT)�default_piprm)rrM�assertNotInr>rWs r�#test_bootstrapping_with_default_pipz1TestBootstrap.test_bootstrapping_with_default_pip�s%������-����,�d�o�o�>rc���|jt�5tjdd��ddd�|j	|j
j�y#1swY�/xYw)NT)rqrt)�assertRaises�
ValueErrorrrM�assertFalser6�calledrWs r�$test_altinstall_default_pip_conflictz2TestBootstrap.test_altinstall_default_pip_conflict�sF��
�
�
�z�
*����4�T�B�+�������,�,�-�+�
*�s�A�A%c��d|jd<tj�|jd|j�y�Nztest fodder�PIP_THIS_SHOULD_GO_AWAY)r>rrMrurWs r�&test_pip_environment_variables_removedz4TestBootstrap.test_pip_environment_variables_removed�s5��6C����1�2��������2�D�O�O�Drc��tj�|j|jdtj
�y�N�PIP_CONFIG_FILE)rrMrr>rr:rWs r�test_pip_config_file_disabledz+TestBootstrap.test_pip_config_file_disabled�s.��	����������):�;�R�Z�Z�HrN)r.r/r0rSrXr[r^rcrgrkrorrrvr|r�r�r1rrrErEPsG��3�

�	
�	
�	
�	
�	
�J�M�?�.�
E�IrrEc#�p�K���d}nG�fd�d�}|�}t�}tjjd|�}|tjd<	|��||urtjd=y|tjd<y#||urtjd=w|tjd<wxYw�w)Nc���eZdZW�Zy)�fake_pip.<locals>.FakePipN)r.r/r0�__version__)rs�r�FakePipr��s���!�Krr�r")r�sys�modules�get)rr"r��sentinel�orig_pips`    r�fake_pipr��s����������	"�	"��i���x�H��{�{���u�h�/�H��C�K�K���*��	��x�����E�"�!)�C�K�K�����x�����E�"�!)�C�K�K���s�AB6�B�*B6�+B3�3B6c�<�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�
TestUninstallc��td�5tj�ddd�|j|jj
�y#1swY�/xYw)N)r�r�_uninstall_helperrzr6r{rWs r�)test_uninstall_skipped_when_not_installedz7TestUninstall.test_uninstall_skipped_when_not_installed�s:��
�d�^��'�'�)��������,�,�-��^�s�A�Ac�|�td�5tjj�5}t	j
�ddd�ddd�j
�j�}|jd|�|j|jj�y#1swY�gxYw#1swY�kxYw)Nznot a valid versionz!only uninstall a matching version)r��test�support�captured_stderrrr��getvalue�strip�assertInrzr6r{)r�stderr�warnings   r�5test_uninstall_skipped_with_warning_for_wrong_versionzCTestUninstall.test_uninstall_skipped_with_warning_for_wrong_version�s���
�+�
,����-�-�/�6��+�+�-�0�-��/�/�#�)�)�+���
�
�9�7�C�������,�,�-�	0�/��-�
,�s"�B2�B&�B2�&B/	�+B2�2B;c��t�5tj�ddd�|jj	gd��y#1swY�'xYw)N��	uninstall�-y�--disable-pip-version-checkr"�r�rr�r6rNrWs r�test_uninstallzTestUninstall.test_uninstall�s9��
�Z��'�'�)��	
���,�,�
�	
��Z�s�A�Ac��t�5tjd��ddd�|jj	gd��y#1swY�'xYw)NrLr`)r�r�r�rbr"r�rWs r�test_uninstall_with_verbosity_1z-TestUninstall.test_uninstall_with_verbosity_1��;��
�Z��'�'�!�4��	
���,�,�
�	
��Z���A�Ac��t�5tjd��ddd�|jj	gd��y#1swY�'xYw)Nrer`)r�r�r�rfr"r�rWs r�test_uninstall_with_verbosity_2z-TestUninstall.test_uninstall_with_verbosity_2�r�r�c��t�5tjd��ddd�|jj	gd��y#1swY�'xYw)Nrir`)r�r�r�rjr"r�rWs r�test_uninstall_with_verbosity_3z-TestUninstall.test_uninstall_with_verbosity_3s;��
�Z��'�'�!�4��	
���,�,�
�	
��Z�r�c��d|jd<t�5tj�ddd�|j	d|j�y#1swY�&xYwr~)r>r�rr�rurWs rr�z4TestUninstall.test_pip_environment_variables_removed
sG��6C����1�2�
�Z��'�'�)�����2�D�O�O�D��Z�s�A�Ac���t�5tj�ddd�|j|jdt
j�y#1swY�7xYwr�)r�rr�rr>rr:rWs rr�z+TestUninstall.test_pip_config_file_disableds@���Z��'�'�)��������):�;�R�Z�Z�H��Z�s�A�AN)r.r/r0r�r�r�r�r�r�r�r�r1rrr�r��s,��.�
.�
�
�
�	
�E�Irr�zpip c��eZdZd�Zd�Zd�Zy)�TestBootstrappingMainFunctionc��tjj�5}|jt�5tjdg�ddd�ddd�j�j�}|j|t�|j|jj�y#1swY�kxYw#1swY�oxYw�Nz	--version)r�r��captured_stdoutrx�
SystemExitr�_mainr�r�r�EXPECTED_VERSION_OUTPUTrzr6r{�r�stdout�results   r�test_bootstrap_versionz4TestBootstrappingMainFunction.test_bootstrap_version#s���
�\�\�
)�
)�
+�v��"�"�:�.�����
�.�/�,����"�(�(�*������!8�9�������,�,�-�	/�.��,�
+�s"�C�B6�C�6B?	�;C�Cc�d�tjg�}|jjddddtj
jdgtj
j�|jjdd}|jt|�d�|j|d�yrG)
rr�r6rNrrrOrPrrQ)r�	exit_coderRs   rrSz6TestBootstrappingMainFunction.test_basic_bootstrapping+s����O�O�B�'�	����,�,��+�\�>��
�
�!�!�5�
�
�M�M���	
� �<�<�1�1�!�4�Q�7������-�.��2�����A�&rc�t�d|j_tjg�}|j	|d�y�Nre)r6r7rr�r�rr�s  r�test_bootstrapping_error_codez;TestBootstrappingMainFunction.test_bootstrapping_error_code:s,��$%����!��O�O�B�'�	�����A�&rN)r.r/r0r�rSr�r1rrr�r�!s��.�
'�'rr�c��eZdZd�Zd�Zd�Zy)�TestUninstallationMainFunctionc��tjj�5}|jt�5t
jjdg�ddd�ddd�j�j�}|j|t�|j|jj�y#1swY�kxYw#1swY�oxYwr�)r�r�r�rxr�r�
_uninstallr�r�r�rr�rzr6r{r�s   r�test_uninstall_versionz5TestUninstallationMainFunction.test_uninstall_versionBs���
�\�\�
)�
)�
+�v��"�"�:�.��$�$�*�*�K�=�9�/�,����"�(�(�*������!8�9�������,�,�-�	/�.��,�
+�s"�C�!C�C�C		�C�Cc���t�5tjjg�}ddd�|jjgd��|j
d�y#1swY�9xYw)Nr�r)r�rr�r�r6rNrr�s  r�test_basic_uninstallz3TestUninstallationMainFunction.test_basic_uninstallJsU��
�Z�!�,�,�2�2�2�6�I��	
���,�,�
�	
�	
����A�&��Z�s� A#�#A,c���t�5d|j_tjjg�}ddd�|j
d�y#1swY�xYwr�)r�r6r7rr�r�rr�s  r�test_uninstall_error_codez8TestUninstallationMainFunction.test_uninstall_error_codeVsH��
�Z�()�D�L�L�%�!�,�,�2�2�2�6�I��	
����A�&��Z�s�1A�A N)r.r/r0r�r�r�r1rrr�r�@s��.�
'�'rr��__main__)�
contextlibr�os.pathr�r�test.supportr�r�
unittest.mockr�ensurepip._uninstall�TestCaserr3rE�contextmanagerrr�r�r�r�r�r.�mainr1rr�<module>r�s����	��
�������+8�8�$�$�+8�\A�A�(oI�N�H�$5�$5�oI�b���&�Y�&�&�(�*��*�$FI�N�H�$5�$5�FI�V!�#4�9�#4�#4�#6�6��'�N�H�4E�4E�'�>'�^�X�5F�5F�'�:�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists