a  ze”ã@s˜ddlZddlZddlZddlmZmZddlmZddlm Z ddl m Z ddl m Z dZGdd „d e je je jejƒZd d „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') cs¼eZdZ‡fdd„Z‡fdd„Ze ej  d¡d¡e ƒe  e dƒdud ¡e  e d ƒdud ¡d d „ƒƒƒƒZ e ej  d¡d¡e ƒe  e dƒdud ¡e  e d ƒdud ¡dd„ƒƒƒƒZ‡ZS)ÚBuildRpmTestCasecs`ztj d¡Wnty,t d¡‚Yn0tt|ƒ ¡t   ¡|_ 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__©úR/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/tests/test_bdist_rpm.pyrs  zBuildRpmTestCase.setUpcs>t |j¡|jdt_|jdtjdd…<tt|ƒ ¡dS)Nré) rÚchdirrrr rrrÚtearDownrrrrr%s  zBuildRpmTestCase.tearDownÚlinuxz,spurious sdtout/stderr output under Mac OS XZrpmNzthe rpm command is not foundZrpmbuildz!the rpmbuild command is not foundcCsþ| ¡}|tjd<tj |d¡}t |¡| |dft¡| |dfd¡| |dfd¡| |dfd ¡tdd dgd d d d œƒ}d|_ t  |¡dgt _ t |ƒ}d |_d|_| ¡| ¡t tj |d¡¡}| d|¡| d|j¡| d|j¡dS©NÚHOMEZfoozsetup.pyzfoo.pyú#z MANIFEST.inzinclude foo.pyZREADMEÚz0.1Zxxx)ÚnameÚversionZ py_modulesÚurlZauthorZ author_emailTrÚdistzfoo-0.1-1.noarch.rpm)rÚanyzdist/foo-0.1-1.src.rpm)rr'zdist/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©rZtmp_dirZpkg_dirr&ÚcmdZ dist_createdrrrÚ test_quiet-s2   ý  zBuildRpmTestCase.test_quietcCs| ¡}|tjd<tj |d¡}t |¡| |dft¡| |dfd¡| |dfd¡| |dfd ¡tdd dgd d d d œƒ}d|_ t  |¡dgt _ t |ƒ}d |_d|_| ¡| ¡t tj |d¡¡}| d|¡| d|j¡| d|j¡t tj |dd¡¡dSr)r(rr)r*r+r,r-r.rr/rr rrr0r1r2r3r4r5r6Úremover7rrrÚtest_no_optimize_flagXs4   ý  z&BuildRpmTestCase.test_no_optimize_flag)Ú__name__Ú __module__Ú __qualname__rrr Z skipUnlessr ÚplatformÚ startswithrZskipIfrr9r;Ú __classcell__rrrrrs0 ÿÿÿ$ÿÿÿrcCs t t¡S)N)r Z makeSuiterrrrrÚ test_suiteƒsrBÚ__main__)r r rZ test.supportrrZdistutils.corerZdistutils.command.bdist_rpmrZdistutils.testsrZdistutils.spawnrr.ZTempdirManagerZ EnvironGuardZLoggingSilencerZTestCaserrBr<rrrrÚs      ým