
    eX                         d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ dZ G d	 d
ej        ej        ej        ej                  Zedk    r ej                     dS dS )z&Tests for distutils.command.bdist_rpm.    N)requires_zlib)Distribution)	bdist_rpm)support)find_executablezfrom distutils.core import setup
import foo

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

c                       e Zd Z fdZ fdZ ej        ej        	                    d          d           e
             ej         ed          du d           ej         ed          du d	           ej        ej        j        d
          d                                                             Z ej        ej        	                    d          d           e
             ej         ed          du d           ej         ed          du d	           ej        ej        j        d
          d                                                             Z xZS )BuildRpmTestCasec                 V   	 t           j                            d           n"# t          $ r t	          j        d          w xY wt          t          |                                            t          j
                    | _        t           j        t           j        d d          f| _        d S )NzUTF-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    0  /home/conda/feedstock_root/build_artifacts/python-split_1708115622739/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/distutils/tests/test_bdist_rpm.pyr   zBuildRpmTestCase.setUp   s    	PN!!'****! 	P 	P 	P#$NOOO	P 	%%++---IKKHchqqqk1s	   # Ac                     t          j        | j                   | j        d         t          _        | j        d         t          j        d d <   t          t          |                                            d S )Nr      )	r   chdirr   r   r   r   r   r	   tearDownr   s    r   r   zBuildRpmTestCase.tearDown%   s_    
"###$Q''*%%..00000    linuxz,spurious sdtout/stderr output under Mac OS XrpmNzthe rpm command is not foundrpmbuildz!the rpmbuild command is not foundz'PYTHONSAFEPATH changes default sys.pathc           	         |                                  }|t          j        d<   t          j                            |d          }t          j        |           |                     |dft                     |                     |dfd           |                     |dfd           |                     |dfd	           t          dd
dgdddd          }d|_	        t          j
        |           dgt          _        t          |          }d|_        d|_        |                                 |                                 t          j        t          j                            |d                    }|                     d|           |                     d|j                   |                     d|j                   d S NHOMEfoozsetup.pyzfoo.py#zMANIFEST.inzinclude foo.pyREADME z0.1xxx)nameversion
py_modulesurlauthorauthor_emailTr   distzfoo-0.1-1.noarch.rpm)r   anyzdist/foo-0.1-1.src.rpm)r   r3   zdist/foo-0.1-1.noarch.rpm)mkdtempr   environpathjoinmkdir
write_fileSETUP_PYr   script_namer   r   r   r   
fix_pythonquietensure_finalizedrunlistdirassertIn
dist_filesr   tmp_dirpkg_dirr2   cmddist_createds         r   
test_quietzBuildRpmTestCase.test_quiet-   s    ,,..$
6',,w..
*-x888(+S111-02BCCC(+R000Uu,17$)U-24 4 5 5 &
<oo 				z"',,w"?"?@@,l;;; 	DdoVVVGYYYYYr    c           	         |                                  }|t          j        d<   t          j                            |d          }t          j        |           |                     |dft                     |                     |dfd           |                     |dfd           |                     |dfd	           t          dd
dgdddd          }d|_	        t          j
        |           dgt          _        t          |          }d|_        d|_        |                                 |                                 t          j        t          j                            |d                    }|                     d|           |                     d|j                   |                     d|j                   t          j        t          j                            |dd                     d S r%   )r4   r   r5   r6   r7   r8   r9   r:   r   r;   r   r   r   r   r<   r=   r>   r?   r@   rA   rB   removerC   s         r   test_no_optimize_flagz&BuildRpmTestCase.test_no_optimize_flag[   s    ,,..$
6',,w..
*-x888(+S111-02BCCC(+R000Uu,17$)U-24 4 5 5 &
<oo				z"',,w"?"?@@,l;;; 	DdoVVVGYYY
	"',,w0FGGHHHHHr    )__name__
__module____qualname__r   r   r   
skipUnlessr   platform
startswithr   skipIfr   flags	safe_pathrH   rK   __classcell__)r   s   @r   r	   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0D88: : X_SY(>@ @ 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0D88: : X_SY(>@ @!I !I@ @: :5 5 _I I!I !I !I !I !Ir    r	   __main__)__doc__r   r   r   test.supportr   distutils.corer   distutils.command.bdist_rpmr   distutils.testsr   distutils.spawnr   r:   TempdirManagerEnvironGuardLoggingSilencerTestCaser	   rL   main r    r   <module>rc      s    , ,  



 				 & & & & & & ' ' ' ' ' ' 1 1 1 1 1 1 # # # # # # + + + + + +qI qI qI qI qIw-+.(qI qI qIf zHMOOOOO r    