ó ž­çSc@s»dZddlZddlZddlZddlZddlZddlZddlZddlZ ddlm Z m Z d„Z dej fd„ƒYZedkr·ejƒndS(sdevelop tests iÿÿÿÿN(tDirectorySandboxtSandboxViolationcCs=tjjdƒstSytdƒWntk r8tSXtS(sp Run this to determine if the local machine has win32com, and if it does, include additional tests. twin32twin32com(tsystplatformt startswithtFalset __import__t ImportErrortTrue(((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyt has_win32coms t TestSandboxcBs_eZd„Zd„Zd„Zd„ZeeƒZeƒrKd„Znd„Z d„Z RS(cCstjƒ|_dS(N(ttempfiletmkdtemptdir(tself((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pytsetUpscCstj|jƒdS(N(tshutiltrmtreeR(R((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyttearDown scCs,t|jƒ}|j|jtjƒƒdS(N(RRtrunt _file_writertostdevnull(Rtsandbox((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyt test_devnull#scs‡fd†}|S(Ncs*tˆdƒ}|jdƒ|jƒdS(Ntwtxxx(topentwritetclose(tf(tpath(sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pytdo_write(s ((R!R"((R!sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyR'scCs¢ddl}|j}tjj|dƒ}t|jƒ}z?y|j|j|ƒƒWnt k rv|j dƒnXWdtjj |ƒrtj |ƒnXdS(sm win32com should not be prevented from caching COM interfaces in gen_py. iÿÿÿÿNt test_writes4Could not create gen_py file due to SandboxViolation( Rt __gen_path__RR!tjoinRRRRRtfailtexiststremove(RRtgen_pyttargetR((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyt test_win32com1s   cCs>tjtdƒ}tjdƒ}tjj|t|ƒƒdS(sT It should be possible to execute a setup.py with a Byte Order Mark sscript-with-bom.pyt namespaceN( t pkg_resourcestresource_filenamet__name__ttypest ModuleTypet setuptoolsRt _execfiletvars(RR*R,((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyttest_setup_py_with_BOMBs   cCsWtjj|jdƒ}t|dƒ}|jdƒWdQXtjj|t ƒƒdS(Nssetup.pytwbs"degenerate script" ( RR!R%RRRR2RR3tglobals(Rtsetup_pytstream((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyttest_setup_py_with_CRLFLs( R/t __module__RRRRt staticmethodR R+R5R:(((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyR s        t__main__(t__doc__RRRtunittestR R0R-tsetuptools.sandboxR2RRR tTestCaseR R/tmain(((sG/usr/local/lib/python2.7/site-packages/setuptools/tests/test_sandbox.pyts         7