ó {G_Tc@s¡ddlZddlZddlZddlZddlZddlmZdejfd„ƒYZdejfd„ƒYZ d„Z e dkre ƒndS( iÿÿÿÿN(t test_supporttFileCompareTestCasecBs,eZd„Zd„Zd„Zd„ZRS(cCs·tj|_tjd|_tjd|_d}xF|j|j|jgD],}t|dƒ}|j|ƒ|jƒqKWt|jdƒ}|jdƒ|jƒtj ƒ|_ dS(Ns-sames-diffsContents of file go here. twsa+sAn extra line. ( RtTESTFNtnamet name_samet name_difftopentwritetclosettempfilet gettempdirtdir(tselftdataRtoutput((s-/usr/local/lib/python2.7/test/test_filecmp.pytsetUps    cCs4tj|jƒtj|jƒtj|jƒdS(N(tostunlinkRRR(R ((s-/usr/local/lib/python2.7/test/test_filecmp.pyttearDownscCs˜|jtj|j|jƒdƒ|jtj|j|jdtƒdƒ|jtj|j|jdtƒdƒ|jtj|j|jƒdƒdS(NsComparing file to itself failstshallows&Comparing file to identical file fails(t assertTruetfilecmptcmpRRtFalse(R ((s-/usr/local/lib/python2.7/test/test_filecmp.pyt test_matchings!!cCsH|jtj|j|jƒdƒ|jtj|j|jƒdƒdS(Ns!Mismatched files compare as equals#File and directory compare as equal(t assertFalseRRRRR (R ((s-/usr/local/lib/python2.7/test/test_filecmp.pyttest_different%s(t__name__t __module__RRRR(((s-/usr/local/lib/python2.7/test/test_filecmp.pyRs   tDirCompareTestCasecBs,eZd„Zd„Zd„Zd„ZRS(cCsYtjƒ}tjj|dƒ|_tjj|dƒ|_tjj|dƒ|_tjjdƒtjjdƒk|_ d}x™|j|j|jgD]}t j |t ƒtj |ƒ|j rÞ||jkrÞd}nd}ttjj||ƒd ƒ}|j|ƒ|jƒqšWttjj|jd ƒd ƒ}|jd ƒ|jƒdS( NR sdir-samesdir-difftAtasContents of file go here. tFiLetfileRtfile2sAn extra file. (R R RtpathtjoinR tdir_sametdir_difftnormcasetcaseinsensitivetshutiltrmtreetTruetmkdirRRR (R ttmpdirRR tfnR((s-/usr/local/lib/python2.7/test/test_filecmp.pyR,s$ '   ! cCs4tj|jƒtj|jƒtj|jƒdS(N(R*R+R R&R'(R ((s-/usr/local/lib/python2.7/test/test_filecmp.pyRBscCs^|jtj|j|jdgƒdgggfkdƒ|jtj|j|jdgƒdgggfkdƒ|jtj|j|jdgdtƒdgggfkdƒ|jtj|j|jdgdtƒdƒttjj |jdƒdƒ}|j dƒ|j ƒ|j tj|j|jddgƒdgdggfkdƒdS( NR"s#Comparing directory to itself failss!Comparing directory to same failsRR#RsDifferent contents. s&Comparing mismatched directories fails( RRtcmpfilesR R&RRRR$R%RR R(R R((s-/usr/local/lib/python2.7/test/test_filecmp.pyt test_cmpfilesGs(!!!!!   cCs/tj|j|jƒ}|jrL|j|j|jgdgdggƒn(|j|j|jgdgdggƒ|j|j dgkƒ|j|j |j ko°gknƒ|j|j dgkƒ|j|j gkƒtj|j|jƒ}|j|jdgkƒ|j|jddgkƒ|j|j dgkƒ|j|j gkƒ|j|j dgkƒ|j|j dgkƒ|j|j gkƒttjj|jdƒdƒ}|jdƒ|jƒtj|j|jƒ}|j|j dgkƒ|j|j dgkƒdS(NR"R!R#RsDifferent contents. (RtdircmpR R&R)t assertEqualt left_listt right_listRtcommont left_onlyt right_onlyt same_filest diff_filesR'RRR$R%RR (R tdR((s-/usr/local/lib/python2.7/test/test_filecmp.pyt test_dircmpcs, +()!  (RRRRR1R<(((s-/usr/local/lib/python2.7/test/test_filecmp.pyR+s   cCstjttƒdS(N(Rt run_unittestRR(((s-/usr/local/lib/python2.7/test/test_filecmp.pyt test_main‚st__main__( RRR*R tunittestttestRtTestCaseRRR>R(((s-/usr/local/lib/python2.7/test/test_filecmp.pyts0 %W