Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/distutils/tests/__pycache__/test_bdist_rpm.cpython-34.pyo

�
i f�@sdZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZd
Zejd�Gdd
�d
e
je
je
jej��Zdd�Zedkree��ndS)z&Tests for distutils.command.bdist_rpm.�N)�run_unittest)�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 buildcseZdZ�fdd�Z�fdd�Zejejj	d�d�ej
ed�dkd	�ej
ed
�dkd�dd
����Zejejj	d�d�ej
ed�dkd	�ej
ed
�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__��C/opt/alt/python34/lib64/python3.4/distutils/tests/test_bdist_rpm.pyr s
zBuildRpmTestCase.setUpcsQtj|j�|jdt_|jdtjdd�<tt|�j�dS)Nr�)	r�chdirrrr
rrr	�tearDown)r)rrrr*szBuildRpmTestCase.tearDown�linuxz,spurious sdtout/stderr output under Mac OS XZrpmNzthe rpm command is not foundZrpmbuildz!the rpmbuild command is not foundcCsx|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�tidd
6dd6dgd
6dd6dd6dd6�}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��namez0.1�version�
py_modules�xxx�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)�	bdist_rpm�anyr,)r.r/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_quiet2s0



	
		

zBuildRpmTestCase.test_quietcCs�|j�}|tjd<tjj|d�}tj|�|j|dft�|j|dfd�|j|dfd�|j|dfd	�tidd
6dd6dgd
6dd6dd6dd6�}d|_	tj
|�dgt_t
|�}d|_d|_|j�|j�tjtjj|d��}|jd|�|jd|j�|jd|j�tjtjj|dd��dS)Nrrzsetup.pyzfoo.pyr zMANIFEST.inzinclude foo.pyr!r"r#z0.1r$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)�	bdist_rpm�anyrD)rFrGrE)r0rr1r2r3r4r5r6rr7rr
rrr8r9r:r;r<r=r>�remove)rr?r@r*rArBrrr�test_no_optimize_flag\s2	



	
		

z&BuildRpmTestCase.test_no_optimize_flag)�__name__�
__module__�__qualname__rrrZ
skipUnlessr
�platform�
startswithZskipIfrrCrIrr)rrr	s
%r	cCs
tjt�S)N)rZ	makeSuiter	rrrr�
test_suite�srO�__main__)�__doc__rr
rZtempfileZshutilZtest.supportrZdistutils.corerZdistutils.command.bdist_rpmrZdistutils.testsrZdistutils.spawnrZ	distutilsrZdistutils.errorsrr6Z_skipInRpmBuildZTempdirManagerZEnvironGuardZLoggingSilencerZTestCaser	rOrJrrrr�<module>s*	h