Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/test_bdist_rpm.cpython-35.opt-2.pyc



$�Yf2�@sddlZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZd	Zejd
�Gdd�dejejejej��Zd
d�Zedkr�ee��dS)�N)�run_unittest�
requires_zlib)�Distribution)�	bdist_rpm)�support)�find_executable)�spawn)�DistutilsExecErrorz�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�S)�BuildRpmTestCasecs}ytjjd�Wn!tk
r7tjd��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/python35/lib64/python3.5/test_bdist_rpm.pyrs
zBuildRpmTestCase.setUpcsQtj|j�|jdt_|jdtjdd�<tt|�j�dS)Nr�)	r�chdirrrrrrr
�tearDown)r)rrrr(szBuildRpmTestCase.tearDown�linuxz,spurious sdtout/stderr output under Mac OS XZrpmNzthe rpm command is not foundZrpmbuildz!the rpmbuild command is not foundc
Csr|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�td
dddd
dgddddddi�}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��name�versionz0.1�
py_modules�url�xxx�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_namerrrr�
fix_python�quiet�ensure_finalized�run�listdir�assertIn�
dist_files)r�tmp_dir�pkg_dirr+�cmd�dist_createdrrr�
test_quiet0s0	

		
		

zBuildRpmTestCase.test_quietc
Cs�|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�td
dddd
dgddddddi�}d|_	tj
|�dgt_t
|�}d|_d|_|j�|j�tjtjj|d��}|jd|�|jd|j�|jd|j�tjtjj|dd��dS)Nrr zsetup.pyzfoo.pyr!zMANIFEST.inzinclude foo.pyr"r#r$r%z0.1r&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,rC)rr,rD)r/rr0r1r2r3r4r5rr6rrrrr7r8r9r:r;r<r=�remove)rr>r?r+r@rArrr�test_no_optimize_flag[s2


		
		

z&BuildRpmTestCase.test_no_optimize_flag)�__name__�
__module__�__qualname__rrrZ
skipUnlessr�platform�
startswithrZskipIfrrBrFrr)rrr
s 
%r
cCs
tjt�S)N)rZ	makeSuiter
rrrr�
test_suite�srL�__main__)rrrZtest.supportrrZdistutils.corerZdistutils.command.bdist_rpmrZdistutils.testsrZdistutils.spawnrZ	distutilsrZdistutils.errorsr	r5Z_skipInRpmBuildZTempdirManagerZEnvironGuardZLoggingSilencerZTestCaser
rLrGrrrr�<module>s$	j