Current File : //usr/local/apps/python3/lib/python3.11/distutils/tests/__pycache__/test_bdist_rpm.cpython-311.pyc
�

�Ke�����dZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZddl
mZdZGd	�d
ejejejej��Zd�Zedkree����dSdS)
z&Tests for distutils.command.bdist_rpm.�N)�run_unittest�
requires_zlib)�Distribution)�	bdist_rpm)�support)�find_executablez�from distutils.core import setup
import foo

setup(name='foo', version='0.1', py_modules=['foo'],
      url='xxx', author='xxx', author_email='xxx')

c����eZdZ�fd�Z�fd�Zejej�	d��d��e
��ejed��dud��ejed��dud	��ejej
jd
��d�����������Zejej�	d��d��e
��ejed��dud��ejed��dud	��ejej
jd
��d�����������Z�xZS)
�BuildRpmTestCasec�V��	tj�d��n"#t$rt	jd���wxYwt
t|�����tj
��|_tjtjdd�f|_
dS)NzUTF-8z(sys.executable is not encodable to UTF-8)�sys�
executable�encode�UnicodeEncodeError�unittest�SkipTest�superr
�setUp�os�getcwd�old_location�argv�old_sys_argv��self�	__class__s ��H/usr/local/apps/python3/lib/python3.11/distutils/tests/test_bdist_rpm.pyrzBuildRpmTestCase.setUps����	P��N�!�!�'�*�*�*�*��!�	P�	P�	P��#�$N�O�O�O�	P����	���%�%�+�+�-�-�-��I�K�K����H�c�h�q�q�q�k�1����s	�#�Ac����tj|j��|jdt_|jdtjdd�<t
t|�����dS)Nr�)	r�chdirrrrrrr
�tearDownrs �rr zBuildRpmTestCase.tearDown%s_���
���"�#�#�#��$�Q�'����'��*�������
���%�%�.�.�0�0�0�0�0��linuxz,spurious sdtout/stderr output under Mac OS X�rpmNzthe rpm command is not found�rpmbuildz!the rpmbuild command is not foundz'PYTHONSAFEPATH changes default sys.pathc	��|���}|tjd<tj�|d��}tj|��|�|dft��|�|dfd��|�|dfd��|�|dfd	��tdd
dgdddd���}d|_	tj
|��dgt_t|��}d
|_d|_|���|���tjtj�|d����}|�d|��|�d|j��|�d|j��dS�N�HOME�foozsetup.pyzfoo.py�#zMANIFEST.inzinclude foo.py�README�z0.1�xxx)�name�version�
py_modules�url�author�author_emailTr�distzfoo-0.1-1.noarch.rpm)r�anyzdist/foo-0.1-1.src.rpm)rr4zdist/foo-0.1-1.noarch.rpm)�mkdtempr�environ�path�join�mkdir�
write_file�SETUP_PYr�script_namerrrr�
fix_python�quiet�ensure_finalized�run�listdir�assertIn�
dist_files�r�tmp_dir�pkg_dirr3�cmd�dist_createds      r�
test_quietzBuildRpmTestCase.test_quiet-s����,�,�.�.��$��
�6���'�,�,�w��.�.��
����������*�-�x�8�8�8�����(�+�S�1�1�1�����-�0�2B�C�C�C�����(�+�R�0�0�0��U�u�,1�7�$)�U�-2�4�4�5�5��&���
�������<�����o�o�������	����������	�	�	��z�"�'�,�,�w��"?�"?�@�@���
�
�,�l�;�;�;�	
�
�
�D�d�o�V�V�V��
�
�G���Y�Y�Y�Y�Yr!c	���|���}|tjd<tj�|d��}tj|��|�|dft��|�|dfd��|�|dfd��|�|dfd	��tdd
dgdddd���}d|_	tj
|��dgt_t|��}d
|_d|_|���|���tjtj�|d����}|�d|��|�d|j��|�d|j��tjtj�|dd����dSr&)r5rr6r7r8r9r:r;rr<rrrrr=r>r?r@rArBrC�removerDs      r�test_no_optimize_flagz&BuildRpmTestCase.test_no_optimize_flag[s����,�,�.�.��$��
�6���'�,�,�w��.�.��
����������*�-�x�8�8�8�����(�+�S�1�1�1�����-�0�2B�C�C�C�����(�+�R�0�0�0��U�u�,1�7�$)�U�-2�4�4�5�5��&���
�������<�����o�o�������	����������	�	�	��z�"�'�,�,�w��"?�"?�@�@���
�
�,�l�;�;�;�	
�
�
�D�d�o�V�V�V��
�
�G���Y�Y�Y�
�	�"�'�,�,�w��0F�G�G�H�H�H�H�Hr!)�__name__�
__module__�__qualname__rr r�
skipUnlessr�platform�
startswithr�skipIfr�flags�	safe_pathrIrL�
__classcell__)rs@rr
r
s�������
2�2�2�2�2�1�1�1�1�1��X����0�0��9�9�G�I�I��]�_�_��X�_�_�_�U�+�+�t�3�3�5�5��X�_�_�_�Z�0�0�D�8�8�:�:��X�_�S�Y�(�>�@�@� Z� Z�@�@�:�:�5�5��_�I�I� Z�H�X����0�0��9�9�G�I�I��]�_�_��X�_�_�_�U�+�+�t�3�3�5�5��X�_�_�_�Z�0�0�D�8�8�:�:��X�_�S�Y�(�>�@�@�!I�!I�@�@�:�:�5�5��_�I�I�!I�!I�!I�!I�!Ir!r
c�X�tj���t��S)N)r�
TestLoader�loadTestsFromTestCaser
�r!r�
test_suiter[�s ���� � �6�6�7G�H�H�Hr!�__main__)�__doc__rrr�test.supportrr�distutils.corer�distutils.command.bdist_rpmr�distutils.testsr�distutils.spawnrr;�TempdirManager�EnvironGuard�LoggingSilencer�TestCaser
r[rMrZr!r�<module>rgs ��,�,�����
�
�
�
�	�	�	�	�4�4�4�4�4�4�4�4�'�'�'�'�'�'�1�1�1�1�1�1�#�#�#�#�#�#�+�+�+�+�+�+���qI�qI�qI�qI�qI�w�-��+��.��(�qI�qI�qI�fI�I�I��z����L�����������r!