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
X\¬Qc@s¹dZddlZddlZddlZddlmZddlZddlmZmZm    Z    m
Z
m Z dZ dej fd„ƒYZd„Zed    krµejd
d ƒndS( s%TestCases for exercising a Recno DB.
iÿÿÿÿN(tpprint(tdbt test_supporttverbosetget_new_environment_pathtget_new_database_patht4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZtSimpleRecnoTestCasecBs†eZejd ks3ejd krNejdkrNdd„Zdd„Znd„Zd„Zd„Z    d    „Z
d
„Z d „Z RS(iiiicCs|jt|ƒ|d|ƒS(Ntmsg(t assertEqualttype(tselftobjtdatatypeR((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pytassertIsInstancescCs|j||kd|ƒS(NR(t
assertTrue(R tatbR((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pytassertGreaterEqualscCstƒ|_d|_dS(N(RtfilenametNonethomeDir(R ((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pytsetUps cCs0tj|jƒ|jr,tj|jƒndS(N(RtunlinkRRtrmtree(R ((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyttearDowns    c Cstjƒ}|jdƒ}|j|ƒ|j|jtjtjƒxNtD]F}|j|dƒ}|j    |t
ƒ|j |dƒt rK|GqKqKWt rŸHn|j ƒ}t r¾t|ƒnxbtdt|ƒdƒD]G}||}t rö|GHn|j    |tƒ|j||j|ƒƒqØWy|d}Wngtjk
rš}tjdkro|j|dtjƒn|j|jdtjƒt r¨|GHq¨nX|jdƒy|jdƒWntjk
rÑ}nX|jdƒy|d}Wntk
rnX|jdƒy|jdƒ}Wn,tjk
rO}|r`|jd    ƒq`nX|j|dƒ|jƒ}t rz|GHn|j    |t ƒ|j    |dt
ƒ|jt|ƒt|ƒƒ|j!ƒ}    t rÙt|    ƒn|j    |    t ƒ|j    |    dt"ƒ|jt|    dƒdƒ|j    |    ddt
ƒ|j    |    ddtƒ|jt|    ƒt|ƒƒ|j#|jd
ƒƒ|d
=|j$|jd
ƒƒ|j%d ƒ|j$|jd ƒƒ|j&d d dƒ}|j|d dd|ƒt rø|GHn|j'ƒ}
t r|
GHn|j(ƒ} | j)ƒ} x$| rPt rA| GHn| j*ƒ} q-W| j+dƒ| j,ƒ} t rx| GHn| j-ddtj.ƒ| j+dƒ| j,ƒ} |j| dƒt rÅ| GHn| j/dƒ} t râ| GHn| j/dƒ} |j| dƒt r| GHn| j0ƒ|j0ƒtjƒ}|j|jƒ|j(ƒ} d|d<|j|ddƒy|d}Wntk
rŠnX|jdƒy|jdƒWn}tj1k
r(}|rÔ|jdƒq?tjdkrý|j|dtj2ƒn|j|jdtj2ƒt r?|GHq?nX|s?|jdƒn| j+dƒ} x$| rtt re| GHn| j*ƒ} qQW| j0ƒ|j0ƒdS(Nii<iiisexpected exceptions(has_key did not raise a proper exceptionidsunexpected exceptionii itzswas %ri2iÿÿÿÿsa replacement recordii?Bs way out thereics$unexpected DBKeyEmptyError exceptioni((ii(i2sa replacement record(ii(3RtDBtset_get_returns_nonetopenRtDB_RECNOt    DB_CREATEtletterstappendRtintRRtstatRtrangetlentstrR    tgettDBInvalidArgErrortsyst version_infotEINVALtargstfailthas_keytDBErrortKeyErrortDBNotFoundErrorRtkeystlisttitemsttupleRt assertFalsetdeletetget_bothtfdtcursortfirsttnexttsettcurrenttputt
DB_CURRENTt    set_rangetclosetDBKeyEmptyErrort DB_KEYEMPTY( R tdtget_returns_nonetxtrecnoR#tdatatvalR2R4R9tctrec((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyt test01_basic"sþ       
                    
 
 
       
cCs!tƒ}||_tjj|dƒ}tjj|ƒsItj|ƒnt|dƒ}|jƒt    j
ƒ}|j dƒ|j dƒ|j |ƒ|j|j t    jt    jƒdjƒ}x|D]}|j|ƒqÄW|jƒ|jƒt|dƒ}|jƒ}|jƒ|jƒ}trA|GH|GH|jdƒGHn|j|jdƒ|ƒt    j
ƒ}|j |ƒ|j|j t    jƒd|d<d    |d
<|jƒ|jƒt|dƒ}|jƒ}|jƒ|jƒ}trþ|GH|jdƒGHn|j|jdƒd jƒƒd S( s
        A Recno file that is given a "backing source file" is essentially a
        simple ASCII file.  Normally each record is delimited by 
 and so is
        just a line in the file, but you can set a different record delimiter
        if needed.
        stest_recno.txttwi
s
s,The quick brown fox jumped over the lazy dogtrs reddish-brownitcomatoseis8The quick reddish-brown fox jumped over the comatose dogN(RRtostpathtjointisdirtmkdirRRBRRt set_re_delimt set_re_sourceRRRtsplitR!tsynctreadtstripRR    (R RtsourcetfRERItdatumttext((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyttest02_WithSourceÌsT        
 
 
 
 
 
 
 
 
 cCsetjƒ}|jdƒ|jdƒ|jdƒ|j|jtjtjƒxtD]}|j    |dƒqVW|j    ddƒy|j    ddƒWngtj
k
r}t j d krÕ|j |d
tjƒn|j |jd
tjƒtr|GHqnX|jd ƒ|jƒ}|jƒ}x$|rLtr=|GHn|jƒ}q)W|jƒ|jƒdS( Ni(t-i-i#t.tbadiiiisexpected exception(ii(RRt
set_re_lent
set_re_padRRRRR R!R(R)R*R    R+R,RR-R:R;R<RB(R RERGRJRKRL((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyttest03_FixedLength
s2             
cCsˆtjƒ}|j|jdtjdtjƒ|jdƒ}|jd|jd|ƒƒ|jdƒ}|jd|jd|ƒƒdS(Ntdbtypetflagst itkeyti(    RRRRRRR!R    tget_size(R REtrow_id((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyttest04_get_size_empty+s  "(ii(ii(iiN( t__name__t
__module__R)R*RRRRRRMR`RfRn(((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyRs             ª    >    !cCs tjtƒS(N(tunittestt    makeSuiteR(((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyt
test_suite;st__main__t defaultTestRs(t__doc__RQR)terrnoRRqttest_allRRRRRR tTestCaseRRsRotmain(((s]/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/bsddb/test/test_recno.pyt<module>s  (ÿ,