Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/test_bdist_rpm.cpython-36.opt-2.pyc

3

 f��@s�ddlZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
dZejd�Gd	d
�d
ejejejej��Zdd�Zed
kr�ee��dS)�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')

z8don't try to nest one rpm build inside another rpm buildcs�eZdZ�fdd�Z�fdd�Zejejj	d�d�e
ejed�dkd	�ejed
�dkd�dd
�����Z
ejejj	d�d�e
ejed�dkd	�ejed
�dkd�dd�����Z�ZS)�BuildRpmTestCasecsbytjjd�Wntk
r.tjd��YnXtt|�j�t	j
�|_tjtjdd�f|_
dS)NzUTF-8z(sys.executable is not encodable to UTF-8)�sys�
executable�encode�UnicodeEncodeError�unittestZSkipTest�superr�setUp�os�getcwd�old_location�argv�old_sys_argv)�self)�	__class__��3/opt/alt/python36/lib64/python3.6/test_bdist_rpm.pyrs
zBuildRpmTestCase.setUpcs>tj|j�|jdt_|jdtjdd�<tt|�j�dS)Nr�)	r�chdirrrr	rrr�tearDown)r)rrrr&szBuildRpmTestCase.tearDown�linuxz,spurious sdtout/stderr output under Mac OS XZrpmNzthe rpm command is not foundZrpmbuildz!the rpmbuild command is not foundcCs�|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�tdd
dgdddd��}d|_	tj
|�dgt_t
|�}d
|_d|_|j�|j�tjtjj|d��}|jd|�|jd|j�|jd|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.rpmr�any�dist/foo-0.1-1.src.rpm�dist/foo-0.1-1.noarch.rpm)rr*r+)rr*r,)�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_dirr)�cmd�dist_createdrrr�
test_quiet.s0	



zBuildRpmTestCase.test_quietcCs|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�tdd
dgdddd��}d|_	tj
|�dgt_t
|�}d
|_d|_|j�|j�tjtjj|d��}|jd|�|jd|j�|jd|j�tjtjj|dd��dS)Nrrzsetup.pyzfoo.pyrzMANIFEST.inzinclude foo.pyr r!z0.1r")r#r$r%r&r'r(Trr)zfoo-0.1-1.noarch.rpmrr*�dist/foo-0.1-1.src.rpm�dist/foo-0.1-1.noarch.rpm)rr*rA)rr*rB)r-rr.r/r0r1r2r3rr4rr	rrr5r6r7r8r9r:r;�remove)rr<r=r)r>r?rrr�test_no_optimize_flagYs2




z&BuildRpmTestCase.test_no_optimize_flag)�__name__�
__module__�__qualname__rrr
Z
skipUnlessr	�platform�
startswithrZskipIfrr@rD�
__classcell__rr)rrrs 
%rcCs
tjt�S)N)r
Z	makeSuiterrrrr�
test_suite�srK�__main__)r
r	rZtest.supportrrZdistutils.corerZdistutils.command.bdist_rpmrZdistutils.testsrZdistutils.spawnrr3Z_skipInRpmBuildZTempdirManagerZEnvironGuardZLoggingSilencerZTestCaserrKrErrrr�<module>s 	
j