tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Q\¬Qc@s
dZddlmZddlZddlZddlZddlZddlmZm    Z    m
Z
m Z m Z ddl Z ddlZy(ddlZejejejƒZWneefk
rÇnXdZdejfd„ƒYZd„Zed    kreƒndS(
s9Test largefile support on system where this makes sense.
iÿÿÿÿ(tprint_functionN(t run_unittesttTESTFNtverbosetrequirestunlinkIù•t LargeFileTestcBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s@Test that each file function works as expected for a large
    (i.e. > 2GB, do  we have to check > 4GB) files.
 
    NOTE: the order of execution of the test methods is important! test_seek
    must run first to create the test file. File cleanup must also be handled
    outside the test instances because of this.
 
    cCs­trtdƒn|jtdƒ‚}|jdƒ|jdƒ|jtƒ|jdƒ|jƒtrytdƒn|jt    j
|j ƒƒt j tdƒWdQXdS(Ns3create large file via seek (may be sparse file) ...twbtzitascheck file size with os.fstati(RtprinttopenRtwritetseektsizetflusht assertEqualtostfstattfilenotstattST_SIZE(tselftf((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt    test_seek&s     
 cCs;trtdƒn|jtjtƒtjtdƒdS(Nscheck file size with os.stati(RR
RRRRRR(R((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt test_osstat3s cCs\trtdƒn|jtdƒ1}|j|jƒdƒ|j|jdƒdƒ|j|jƒdƒ|jdƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jdƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒdƒ|jddƒ|j|jƒtddƒ|jd    dƒ|j|jƒtdd
ƒ|jt ddƒ|j|jƒdƒ|jtƒ|j|jƒtƒ|j|jdƒd ƒ|jt ddƒ|j|jdƒdƒ|j|jƒdƒWdQXdS( Ns;play around with seek() and read() with the built largefiletrbiiRi*iTiiöÿÿÿi
R    (    RR
R RRttelltreadR R(RR((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyttest_seek_read8s<    c    Csˆtrtdƒn|jtdƒ]}|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒdƒ|jtj|jƒddƒtddƒ|jtj|jƒddƒtdd    ƒ|jtj|jƒt ddƒdƒ|jtj|jƒtdƒtƒ|j|j    dƒd
ƒWdQXdS( Ns4play around with os.lseek() with the built largefileRii*iiTiiöÿÿÿi
R    (
RR
R RRRtlseekRRR(RR((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt
test_lseekYs %%%%--*%cCs«trtdƒn|jtdƒ€}t|dƒsItjdƒ‚n|jddƒ|j|j    ƒt
dƒt
d}|j|ƒ|j ƒ|j|j    ƒ|ƒ|jddƒ|j|j    ƒ|ƒ|d8}|jd    ƒ|j |ƒ|j r|j|j    ƒd    ƒn|jddƒ|j|j    ƒ|ƒ|jdƒ|j dƒ|j rx|j|j    ƒdƒn|jdƒ|jt |jƒƒdƒWdQXdS(
Ns try truncatesr+bttruncates.open().truncate() not available on this systemiiii
i*(RR
R RthasattrtunittesttSkipTestR RRRR tnew_iotlenR(RRtnewsize((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt test_truncatehs4 
 
 
             cCsr|js|jdƒnxRddd
fD]A}|jtdƒ'}|j|ƒ|j|jƒƒWdQXq)WdS( Ns$builtin file doesn't have seekable()iiiRI€iÿÿÿI€I€I€(R$tskipTestR RR t
assertTruetseekable(RtposR((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt test_seekableŒs      (    t__name__t
__module__t__doc__RRRRR'R,(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyRs            !        $c    Cstjd dks"tjdkr<tddttƒƒn„ttdddƒ}y(|jd    ƒ|jd
ƒ|j    ƒWn:t
t fk
rµ|j ƒt tƒtjd ƒ‚n X|j ƒtjƒ}xtjd ftjd ftdfgD]ö\}}dtfd„ƒY}t|ƒ|_|tk    |_|tj|_|j|dƒƒ|j|dƒƒ|j|dƒƒ|j|dƒƒ|tdƒ,}t|dƒrÇ|j|dƒƒnWdQX|j|dƒƒt tƒqôWzt|ƒWdt tƒXdS(Nitwintdarwint    largefiles-test requires %s bytes and a long time to runRt    bufferingiI€txs*filesystem does not have largefile supporttCtPytBuiltintTestCasecBseZRS((R-R.(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyR8´sRRRRR R'R,(tsystplatformRtstrRR RR R RtIOErrort OverflowErrortcloseRR"R#t    TestSuitetiotpyioRt staticmethodR$R-taddTestR!R(Rtsuitet_opentprefixR8((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt    test_main—s@"  
 
 
 t__main__(R/t
__future__RRRR9R"ttest.test_supportRRRRRR@t_pyioRAtsignaltSIGXFSZtSIG_IGNt
oldhandlert ImportErrortAttributeErrorRR8RRGR-(((s[/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_largefile.pyt<module>s$    (   {    0