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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
P\¬Qc@s?ddlmZddlZddlZddlZddlmZddlmZddlZddl    Z
ddl m Z m Z ddlmZdejfd„ƒYZd    efd
„ƒYZd efd „ƒYZd ejfd„ƒYZdefd„ƒYZdefd„ƒYZd„Zedkr;eƒndS(iÿÿÿÿ(tprint_functionN(tarray(tproxy(tTESTFNt run_unittest(tUserListt AutoFileTestscBs}eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „ZRS( cCs|jtdƒ|_dS(Ntwb(topenRtf(tself((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pytsetUpscCs*|jr|jjƒntjtƒdS(N(R    tclosetostremoveR(R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttearDowns    cCskt|jƒ}|jdƒ|j|jjƒ|jƒƒ|jjƒd|_|jtt    |dƒdS(Nt
teststringttell(
RR    twritet assertEqualRR tNonet assertRaisestReferenceErrortgetattr(R
tp((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt testWeakRefss       cCs"|j}|j|j|jdS(N(R    tnametmodetclosed(R
R    ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestAttributes&s    cCsq|jjdƒ|jjƒtddƒ}|jtdƒ|_|jj|ƒ}|jd|jƒ| ƒdS(Nt12tbtxi
trbt
xxxxxxxxxx(    R    RR RRRtreadintoRttostring(R
tatn((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt testReadinto-s  cCsctddƒ}|jjƒ|jtdƒ|_t|jdƒr_|jt|jj|ƒndS(NRR i
trR#R"(    RR    R RRthasattrRt    TypeErrorR#(R
R%((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestReadinto_text6s
 cCsgtddgƒ}|jj|ƒ|jjƒ|jtdƒ|_|jjƒ}|j|dƒdS(Nt1t2R!R(RR    t
writelinesR RRtreadR(R
tltbuf((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestWritelinesUserList>s  cCs&|jt|jjdddgƒdS(Niii(RR*R    R.(R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestWritelinesIntegersGscCs2tdddgƒ}|jt|jj|ƒdS(Niii(RRR*R    R.(R
R0((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestWritelinesIntegersUserListKscCs<ddd„ƒY}|jt|jj|ƒ|ƒgƒdS(Nt    NonStringcBseZRS((t__name__t
__module__(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyR5Rs((RR*R    R.(R
R5((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestWritelinesNonStringPscCs|j}|j|jtƒ|j|jƒ ƒ|j|j ƒt|dƒro|jt    t
f|j dƒn|j ƒ|j|jƒdS(NR#t( R    RRRt
assertTruetisattyRR)RtIOErrorR*R#R (R
R    ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt
testErrorsXs    
cCsiddfddfddfddfddfddfddfd    dfd
dfd dfddfd gffddfg }tjjdƒs¦|jddfƒn|jjdddƒ|j|jjƒx9|D]1\}}t    |j|ƒ}|j
t ||ŒqÖW|j |jjdddƒdƒy dd Wn)|j |jjtj ƒŒdƒnXdS(NtfilenotflushR;tnextR/RR9treadlinet    readlinestseekiRR.t__iter__tatheosttruncatei((((((R9(((i((R9(((tsystplatformt
startswithtappendR    t__exit__RR:RRRt
ValueErrorRtexc_info(R
tmethodst
methodnametargstmethod((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt testMethodscs2                                             " cCs|jt|jjƒdS(N(RR<R    R/(R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestReadWhenWriting†s(R6R7R RRRR'R+R2R3R4R8R=RRRS(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyRs                                                            #tCAutoFileTestscBseZejZRS((R6R7tioR(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyRT‰stPyAutoFileTestscBseZeejƒZRS((R6R7t staticmethodtpyioR(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyRVŒstOtherFileTestscBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsZxSdD]K}y|jt|ƒ}Wntk
r6qX|jƒ|jd|ƒqWdS(NR9taUswU+s%r is an invalid file mode(R9RZswU+(RRRLR tfail(R
RR    ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestModeStrings’s  
cCsdtjdkr1|jttftjjdƒntddtjƒ|jttftjj    ƒdS(Ntosf1V5iÿÿÿÿsK  Skipping sys.stdin.seek(-1), it may crash the interpreter. Test manually.tfile(
RGRHRR<RLtstdinRCtprintt
__stdout__RF(R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt    testStdins "
cCsŸd}y|jt|ƒ}Wnatk
r}|jddkr›t|ƒ}t|kse||kr||jd|ƒq|q›nX|jƒ|jd|ƒdS(Ntqwertyis&bad error message for invalid mode: %ssno error for invalid mode: %s(RRRLRPtstrR[R (R
tbad_modeR    tmsgts((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestBadModeArgument§s 
cCsåxÞd    D]Ö}y|jtd|ƒ}|jt|ƒjdƒƒ|jƒ|jƒ|jtd|ƒ}t|jƒjdƒƒ}|jƒ|jƒWn0t    k
rÌ}|j
d|t|ƒfƒnX|j ||ƒqWdS(
NiÿÿÿÿiiiRtasciiR!s error setting buffer size %d: %s(iÿÿÿÿiii( RRRRdtencodeR tintR/tdecodeR<R[R(R
RgR    tdRf((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestSetBufferSize·s 
 
 
!cCs8tjtƒ|jtdƒ}zú|jdƒ|jƒ|jtdƒ}|jdƒ}|dkrz|jd|ƒn|jƒdkr¦|jd|jƒƒn|j    ƒ|jƒdkrÜ|jd|jƒƒn|jƒtj
j tƒ}|dkr|jd    |ƒnWd|jƒtjtƒXdS(
NRt 12345678901srb+it12345s(Read on file opened for update failed %rsFile pos after read wrong %ds!File pos after ftruncate wrong %ds"File size after ftruncate wrong %d( R tunlinkRRRR R/R[RRFtpathtgetsize(R
R    tdatatsize((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyttestTruncateOnWindowsÈs(  
 
 
 
cCs¼d}d}|t|ƒ s)tdƒ‚|t|ƒ}dddddd    g}d
dfd d fd d!fd tdddƒffg}z|jtdƒ}|j||ƒ|j|ƒ|jƒxk|D]c\}}|jtdƒ}    t|    ƒ|kr|j    dfnt
|    |ƒ}
|
|Œ|    jƒqÏW|jtdƒ}    xt |ƒD]} t|    ƒqUW|j dƒ} y|    j ƒ} Wntk
r¨|j    dƒnX| | krÏ|j    d| | fƒn|j dƒ} tddt| ƒƒ}y|    j|ƒWntk
r(|j    dƒnX|jƒ} | | kr[|j    d| | fƒn|j dƒ} y|    jt| ƒƒ} Wntk
r£|j    dƒnX| | krÊ|j    d| | fƒny|    jƒ}Wntk
rú|j    dƒnX||kr!|j    d| | fƒn|jtdƒ}    zex|    D]} q=Wy/|    j ƒ|    j|ƒ|    jƒ|    jƒWntk
r–|j    dƒnXWd|    jƒXWdtjtƒXdS("Ni@sham
s*dataoffset must be multiple of len(filler)sspam, spam and eggs
seggs, spam, ham and spam
ssaussages, spam, spam and eggs
sspam, ham, spam and eggs
s(spam, spam, spam, spam, spam, ham, spam
swonderful spaaaaaam.
RAR/RBR#Rt idRR!sBroken testfileisLreadline() after next() with supposedly empty iteration-buffer failed anywaysEreadline() after next() with empty buffer failed. Got %r, expected %rtsLreadinto() after next() with supposedly empty iteration-buffer failed anywaysEreadinto() after next() with empty buffer failed. Got %r, expected %rsHread() after next() with supposedly empty iteration-buffer failed anywaysAread() after next() with empty buffer failed. Got %r, expected %rsMreadlines() after next() with supposedly empty iteration-buffer failed anywaysFreadlines() after next() with empty buffer failed. Got %r, expected %rs'read* failed after next() consumed file((((tlentAssertionErrorRRRRR.R R@R[RtrangetpopRARLR#R$R/RBR Rq(R
t
dataoffsettfillertnchunkst    testlinesRNtbagRORPR    tmethtittestlinetlineR1tlines((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt testIterationæs”         
 
                              
 
 (R6R7R\RbRhRnRvR‡(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyRYs         
           tCOtherFileTestscBseZejZRS((R6R7RUR(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyRˆIstPyOtherFileTestscBseZeejƒZRS((R6R7RWRXR(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyR‰LscCsAztttttƒWdtjjtƒr<tj    tƒnXdS(N(
RRTRVRˆR‰R RrtexistsRRq(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt    test_mainPs
    t__main__(t
__future__RRGR tunittestRtweakrefRRUt_pyioRXttest.test_supportRRRtTestCaseRRTRVRYRˆR‰R‹R6(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_file.pyt<module>s$     w¹