ó {G_Tc@sddlmZejddƒyddlZWnek rIdZnXddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZedZdZd ejfd „ƒYZd ejfd „ƒYZd„Zedkr eƒndS(iÿÿÿÿ(t test_supporttextralargefiles>test requires loads of disk-space bytes and a long time to runN(t TemporaryFile(tTESTFNt run_unittestt2ii<tTestsWithSourceFilecBs>eZd„Zd„Zd„Zer3d„Znd„ZRS(cCsUd„tdƒDƒ}dj|ƒ|_ttdƒ}|j|jƒ|jƒdS(Ncss|]}d|VqdS(sTest of zipfile line %d.N((t.0ti((s//usr/local/lib/python2.7/test/test_zipfile64.pys &si@Bs twb(txrangetjointdatatopenRtwritetclose(tselftline_gentfp((s//usr/local/lib/python2.7/test/test_zipfile64.pytsetUp"s cCsftj|d|dtƒ}dd t|jƒ}tjƒt}xtt|ƒD]f}|jd||jƒ|tjƒkrOtjƒt}t j d||fIJt j j ƒqOqOW|j ƒtj|d|ƒ}x}t|ƒD]o}|j |jd|ƒ|jƒ|tjƒkråtjƒt}t j d ||fIJt j j ƒqåqåW|j ƒdS( Ntwt allowZip64iiistestfn%ds/ zipTest still writing %d of %d, be patient...trs/ zipTest still reading %d of %d, be patient...i@(tzipfiletZipFiletTruetlenR ttimet_PRINT_WORKING_MSG_INTERVALtrangetwritestrtsyst __stdout__tflushRt assertEqualtread(Rtft compressiontzipfpt filecountt next_timetnum((s//usr/local/lib/python2.7/test/test_zipfile64.pytzipTest.s,    cCs1x*tƒtfD]}|j|tjƒqWdS(N(RtTESTFN2R*Rt ZIP_STORED(RR$((s//usr/local/lib/python2.7/test/test_zipfile64.pyt testStoredOscCs1x*tƒtfD]}|j|tjƒqWdS(N(RR+R*Rt ZIP_DEFLATED(RR$((s//usr/local/lib/python2.7/test/test_zipfile64.pyt testDeflatedVscCs=x6ttfD](}tjj|ƒr tj|ƒq q WdS(N(RR+tostpathtexiststremove(Rtfname((s//usr/local/lib/python2.7/test/test_zipfile64.pyttearDown\s(t__name__t __module__RR*R-tzlibR/R5(((s//usr/local/lib/python2.7/test/test_zipfile64.pyR!s  !  t OtherTestscBseZd„Zd„ZRS(cCstjtddƒ}d|_d d}x4t|ƒD]&}|jd|d |dd ƒq5W|jt|jƒƒ|ƒ|j ƒtjtdd ƒ}|jt|jƒƒ|ƒx=t|ƒD]/}|j|j d|ƒd |dd ƒqÃW|j ƒdS(NtmodeRidiiiisfoo%08ds%di9Rii( RRRtdebugR RR"RtnamelistRR#(RtzipftnumfilesRtzipf2((s//usr/local/lib/python2.7/test/test_zipfile64.pyttestMoreThan64kFilescs  $ -cCstjtƒtjtƒdS(N(RtunlinkRR+(R((s//usr/local/lib/python2.7/test/test_zipfile64.pyR5ts (R6R7R@R5(((s//usr/local/lib/python2.7/test/test_zipfile64.pyR9bs cCstttƒdS(N(RRR9(((s//usr/local/lib/python2.7/test/test_zipfile64.pyt test_mainxst__main__i,(ttestRtrequiresR8t ImportErrortNoneRR0tunittestRRttempfileRttest.test_supportRRR+RtTestCaseRR9RBR6(((s//usr/local/lib/python2.7/test/test_zipfile64.pyts&  $   A