ó {G_Tc@sŒddlZddlmZddlZddlZejdƒZejdZdej fd„ƒYZ d„Z e dkrˆe ƒndS( iÿÿÿÿN(t test_supporttMacOSt2t TestMacOScBs_eZejejjdƒdƒd„ƒZejejjdƒdƒd„ƒZd„Z RS(s/Developer/Tools/SetFiles'/Developer/Tools/SetFile does not existcCsŸz‡ttjdƒ}|jdƒ|jƒtjdddddtjgƒtjtjƒ\}}|j |dƒ|j |dƒWdt j tjƒXdS(Ntws s/Developer/Tools/SetFiles-ttABCDs-ctEFGH( topenRtTESTFNtwritetcloset subprocesstcallRtGetCreatorAndTypet assertEqualtostunlink(tselftfptcrttp((s+/usr/local/lib/python2.7/test/test_macos.pyttestGetCreatorAndType s   s/Developer/Tools/GetFileInfos+/Developer/Tools/GetFileInfo does not existcCsSz;ttjdƒ}|jdƒ|jƒtjtjddƒtjtjƒ\}}|j|dƒ|j|dƒt j dtjgdt j ƒj ƒd}d}d}xf|jƒD]X}|jdƒrí|jƒd d d !}n|jd ƒr¾|jƒd d d !}q¾q¾W|j|dƒ|j|dƒWdtjtjƒXdS( NRs RRs/Developer/Tools/GetFileInfotstdoutistype:iÿÿÿÿiscreator:(RRRR R RtSetCreatorAndTypeR RR tPopentPIPEt communicatetNonet splitlinest startswithtsplitRR(RRRRtdatatln((s+/usr/local/lib/python2.7/test/test_macos.pyttestSetCreatorAndTypes*    cCszîttjdƒ}|jdƒ|jƒtjtjdƒ}|jdƒ|jƒttjdƒ}|jƒ}|jƒ|j|dƒtjtjdƒ}|jdƒ}|jdƒ}|jƒ|j|dƒ|j|dƒWdt j tjƒXdS( NRs hello world s*wbsgoodbye world trs*rbidt( RRRR R RtopenrftreadRRR(RRtrfpRtdata2((s+/usr/local/lib/python2.7/test/test_macos.pyt testOpenRF?s$       ( t__name__t __module__tunittestt skipUnlessRtpathtexistsRR!R((((s+/usr/local/lib/python2.7/test/test_macos.pyR s  cCstjtƒdS(N(Rt run_unittestR(((s+/usr/local/lib/python2.7/test/test_macos.pyt test_mainZst__main__( R+ttestRRR t import_moduleRRtTESTFN2tTestCaseRR0R)(((s+/usr/local/lib/python2.7/test/test_macos.pyts    P