ó {G_Tc@sdZddlZddlZddlZddlZddlZddlmZmZddlm Z m Z m Z m Z ddl Z ddl mZmZmZmZmZmZmZmZmZmZddlZdejfd„ƒYZd„Zed kreƒndS( sTests for sysconfig.iÿÿÿÿN(tcopytdeepcopy(t run_unittesttTESTFNtunlinkt get_attribute( t get_pathst get_platformtget_config_varstget_pathtget_path_namest_INSTALL_SCHEMESt_get_default_schemet _expand_varstget_scheme_namestget_config_vart TestSysConfigcBsªeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zejejdkdƒd„ƒZRS(cCsùtt|ƒjƒtj|_d|_tt dƒrVt j |_ t j ƒ|_ nd|_ d|_ |j t _ t j |_ tj|_tj|_t j|_t jj|_t jj|_t jj|_ttjƒ|_tt jƒ|_dS(sMake a copy of sys.pathtunameN(tsuperRtsetUptsystpathtsys_pathtNonetmakefilethasattrtosRt_unamet _get_unametnametplatformtversiontseptjointisabst splitdriveRt sysconfigt _CONFIG_VARSt _config_varsRtenviront old_environ(tself((s//usr/local/lib/python2.7/test/test_sysconfig.pyRs$          cCsa|jtj(|jdk r/tj|jƒn|jƒ|jdk rW|jt_nt`|j t_ |j t_ |j t_ |j t_ |j tj_ |jtj_|jtj_t|jƒt_xE|jjƒD]4\}}tjj|ƒ|krÜ|tj|2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]twin32s>2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Amd64)]s win-amd64s@2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Itanium)]swin-ia64tposixsU2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)]tdarwintDarwintmacziades8.11.1s]Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386tPowerPCs10.3tMACOSX_DEPLOYMENT_TARGETsF-fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypestCFLAGSiÿÿÿsmacosx-10.3-ppcIÿÿÿÿÿÿÿsmacosx-10.3-ppc64ti386smacosx-10.3-i386smacosx-10.3-x86_64s10.4sy-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-fats|-arch x86_64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-intels†-arch x86_64 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-fat3s’-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-universals}-arch x86_64 -arch ppc64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-fat64tppctx86_64tppc64sm-arch %s -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3smacosx-10.4-%ssV2.3.5 (#1, Jul 4 2007, 17:28:59) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]tlinux2tLinuxtaglaes2.6.21.1dedibox-r7s #1 Mon Apr 30 17:25:38 CEST 2007ti686s linux-i686(RJRKs8.11.1s]Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386RL(RJRKs8.11.1s]Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386RO(RPRORQRR(RTRUs2.6.21.1dedibox-r7s #1 Mon Apr 30 17:25:38 CEST 2007RV( RRRRRR7RR1t _osx_supportt_remove_original_valuesRtmaxint(R)RYtarch((s//usr/local/lib/python2.7/test/test_sysconfig.pyttest_get_platformnsˆ                                  cCs,tjƒ}|jtjj|ƒ|ƒdS(N(R$tget_config_h_filenameRCRRR2(R)tconfig_h((s//usr/local/lib/python2.7/test/test_sysconfig.pyttest_get_config_h_filenameís cCsd }|jtƒ|ƒdS( NRFtnt_usertos2tos2_hometosx_framework_usert posix_homet posix_prefixt posix_user(sntsnt_usersos2sos2_homesosx_framework_users posix_homes posix_prefixs posix_user(R7R(R)R=((s//usr/local/lib/python2.7/test/test_sysconfig.pyttest_get_scheme_namesñscCs~ttdƒ}d„}tjjtjƒ}tjjtƒ}|||ƒz |j||ƒ||ƒƒWdt |ƒXdS(NtsymlinkcSs1|ddg}tj|dtjƒ}|jƒS(Ns-cs0import sysconfig; print sysconfig.get_platform()tstdout(t subprocesstPopentPIPEt communicate(tpythontcmdtp((s//usr/local/lib/python2.7/test/test_sysconfig.pyR,ùs ( RRRtrealpathRt executabletabspathRR7R(R)RgR,trealtlink((s//usr/local/lib/python2.7/test/test_sysconfig.pyt test_symlinkös   cCsµtdƒ}tdƒ}tjtjk}x„d D]|}t|dƒ}|r|jtjtjƒ}|jtjtjƒ}nt|dƒ}|j||j||d ƒƒq1WdS( Ntbasetuserbasetstdlibt platstdlibtpurelibtplatlibRdRei(sstdlibs platstdlibspurelibsplatlib(RRtprefixt exec_prefixR treplaceR7(R)RvtusertadaptRt global_patht user_path((s//usr/local/lib/python2.7/test/test_sysconfig.pyttest_user_similars   RIstest only relevant on MacOSXc Csntjƒ}tjjƒ}d|kr1|d=ntddƒ7}tjtj ddgdtj d|d|ƒ}WdQX|j ƒd j ƒ}|j d ƒ}|jƒ}|j|d ƒ|j||ƒtjjƒ}d |dR@RER[R^RfRuRƒtunittestt skipUnlessRRR(((s//usr/local/lib/python2.7/test/test_sysconfig.pyRs             cCsttƒdS(N(RR(((s//usr/local/lib/python2.7/test/test_sysconfig.pyt test_mainDst__main__(t__doc__R’RRR5RiRRttest.test_supportRRRRR$RRRR R R R R RRRWtTestCaseRR”R(((s//usr/local/lib/python2.7/test/test_sysconfig.pyts     " F ÿ2