{G_Tc@sddlZddlZddlZddlmZeejdsUejdndd Zdd d d d d degZ dj e dZ dj e dZ dj e dZ dj e dZge D]Zed^qZ[dejfdYZdefdYZdefdYZdefdYZdefdYZdefdYZdZedkrendS(!iN(t test_supporttnewliness3This Python does not have universal newline supporttxiisline1=1s>line2='this is a very long line designed to go past the magic s>hundred character limit that is inside fileobject.c and which s?is meant to speed up the common case, but we also want to test sthe uncommon case, naturally.'sdef line3():passs line4 = '%s's s s tTestGenericUnivNewlinescBsSeZdZdZdZdZdZdZdZdZ dZ RS( tUtwbcCs2ttj|j}|j|jWdQXdS(N(topenRtTESTFNt WRITEMODEtwritetDATA(tselftfp((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pytsetUp'scCs"ytjtjWnnXdS(N(tostunlinkRR(R ((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyttearDown+scCs`ttj|j}|j}WdQX|j|t|jt|jt|j dS(N( RRRtREADMODEtreadt assertEqualtDATA_LFtreprRtNEWLINE(R R tdata((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_read1scCs`ttj|j}|j}WdQX|j|t|jt|jt|j dS(N( RRRRt readlinesRt DATA_SPLITRRR(R R R((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyttest_readlines7scCsttj|j?}g}|j}x#|rO|j||j}q-WWdQX|j|t|jt|j t|j dS(N( RRRRtreadlinetappendRRRRR(R R Rtd((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_readline=s   cCsttj|jV}|j|j}|j}|j|td|j ||j}WdQX|j|tddS(Ni( RRRRRttellRRRtseek(R R tposR((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_seekGs    cCsai}tjttj|WdQX|d}|j|jjd|j|dtdS(Ntline3itline4(Rtcheck_py3k_warningstexecfileRRt func_codetco_firstlinenotFATX(R t namespacetfunc((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_execfileQs   ( t__name__t __module__RRR RRRRR#R-(((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR!s     tTestNativeNewlinescBs eZdZeZdZdZRS(trtwN(R.R/tNoneRRR RR(((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR0ZstTestCRNewlinescBseZdZeZRS(s (R.R/RtDATA_CRR (((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR4`stTestLFNewlinescBseZdZeZRS(s (R.R/RRR (((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR6dstTestCRLFNewlinescBseZdZeZdZRS(s cCs{ttj|j>}|jt|jtd|j}|j }WdQX|jt|jt|j dS(N( RRRRRRRR3RR R(R R RR"((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_tellls  (R.R/Rt DATA_CRLFR R8(((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR7hstTestMixedNewlinescBseZdZeZRS(s s (s s (R.R/Rt DATA_MIXEDR (((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyR:sscCstjtttttdS(N(Rt run_unittestR0R4R6R7R:(((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyt test_mainxs t__main__i@(tunittestRtsysttestRthasattrtstdintSkipTestR*t DATA_TEMPLATEtjoinRR5R9R;RRtTestCaseRR0R4R6R7R:R=R.(((s4/usr/local/lib/python2.7/test/test_univnewlines2k.pyts6       9