��Qc@s�ddlZddlZddlZejddkrpyddlZeZWnek
rlddlZnXnddlZddlZddlm Z m
Z
mZmZm
Z
mZdejfd��YZd�Zedkr�jd d
�ndS(i�Nii(tdbtdbtablesttest_supporttverbosetget_new_environment_pathtget_new_database_pathtTableDBTestCasecBsheZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�ZRS(s
test-table.dbcCsuddl}|jddkrAddlm}|t�|_nt�|_tj ddd|jdd �|_
dS(
Ni�ii(tdo_proxy_db_py3ktfilenamestabletest.dbtdbhometcreatei(tsystversion_infottest_allRtFalset_flag_proxy_db_py3kRttestHomeDirRt
bsdTableDBttdb(tselfRR((s./sys/lib/python2.7/bsddb/test/test_dbtables.pytsetUp+s cCs`|jj�ddl}|jddkrLddlm}||j�ntj|j �dS(Ni�ii(R(
RtcloseRRR
RRRtrmtreeR(RRR((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyttearDown5s
cCs�d}d}y|jj|�Wntjk
r6nX|jj||g�ddl}|jddkr�|jj|itj dd�|6�n/|jj|itj dd�j
d�|6�tr�|jj�n|jj
||gd id|6�}ddl}|jddkr8tj|d|�}n tjt|d|d��}|j|d
k�|j|dk�dS(Nttest01scool numbersi�iign��@is iso8859-1t
conditionsgS㥛� @g�`� @(RtDropRtTableDBErrortCreateTableRRtInserttpickletdumpstdecodeRt _db_printtSelecttNonetloadstbytest
assertTrue(RttabnametcolnameRtvaluestcolval((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR=s,) c Cs�d}d}d}d}ddl}|jddkr�itjdd �|6d
|6d|6itjdd �|6d
|6d|6itjd
d �|6d|6d|6g}n�itjdd �jd�|6d
|6d|6itjdd �jd�|6d
|6d|6itjd
d �jd�|6d|6d|6g}y|jj|�Wntjk
rcnX|jj ||||g�x!|D]}|jj
||�q�Wddl}|jddkr�jj||gdid�|6�}n(|jj||gdid�|6�}|jt
|�d�|dddkr[|j|d dd�nP|dddkr�|j|d dd�n!tr�d|fGHntd��dS(Nttest02scoolness factorsbut can it fly?tSpeciesi�iiiitnotPenguintTurkeyi tyessSR-71A Blackbirds iso8859-1RcSstj|�dkS(Ni(RR$(tx((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyt<lambda>}scSstjt|d��dkS(Ns iso8859-1i(RR$R%(R1((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR2�sis
values= %rsWrong values returned!(RRRRR RRRRRRR"tassertEqualtlenRtRuntimeError( RR'tcol0tcol1tcol2RttestinfotrowR)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR+[sH$$-
cCs�d}y|jj|�Wntjk
r0nXtrLdGH|jj�n|jj|dddddg�tr�dGH|jj�n|jj|�tr�d GH|jj�n|jj|dddddg�yY|jj|id
d6tj idd6d
d6dgd�d6dd6�|j
d�Wntjk
rEnXy1|jj|gdidd6�|j
d�Wntjk
r�nX|jj|idd6dd6dd6dd6�|jj|idd6dd6dd6dd6dd6�|jj|idd6dd6dd6dd6d d6�tr?|jj�n|jj|dddgditj
d!�jd6tj
d"�jd6�}|jt|�d#�|jj|ditjd�d6�|jj|dddgditjd$�d6�}|jt|�d�|j|d%dd�|jj|dgdid&�d6�}|jt|�d�|j|d%dd�dS('Nttest03s...before CreateTable...tatbtctdtes...after CreateTable...s...after Drop...tiiiitfooitZerotfsExpected an exceptionRt123t42tbadtmeepsFuzzy wuzzy was a beart581750tgoodtblatblacksfuzzy was heret800000sFuzzy wuzzy is a beartwuzzys^[0-9]+$itFuzzyicSs
|dkS(NRH((R>((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR2�s(RRRRRR!RRRRtfailR"tretcompiletsearchtmatchR3R4tDeletet ExactCondt
PrefixCondR#(RR'R)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR;�s~""
'
& cCs�d}y|jj|�Wntjk
r0nX|jj|dddddg�yY|jj|idd6tjidd 6d
d6dgd
�d6dd6�|jd�Wntjk
r�nX|jj|idd6dd6dd6dd6dd6�|jj|idd6dd6dd6dd6dd6�|jj|idd6dd6dd6dd6dd6�t r{|jj
�n|jj|dddgd itjd�d6tjd�d6tj
d!�d6�}|jt|�d"|�dS(#Nttest04_MultiCondSelectR<R=R>R?R@RAiiiiRBiRCRDsExpected an exceptiontAtBtCtDtEs-As-Bs-Cs-Ds-EsA-sB-sC-sD-sE-Rt-i(RRRRRRRRRPRR!R"RVRWR3R4(RR'R)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyRX�s6"
'+++cCs�d}|jj|dddddg�y9|jj|idd6dd6dd 6�|jd
�WnnX|jj|ddd g�|jj|idd6dd6dd 6�|jj|idd6dd6dd 6d
d6�dS(Nttest_CreateOrExtendtnamettastetfillingsalcohol contenttpricetcrapR-sis it Guinness?s.Insert should've failed due to bad column nametgreatR0tGuinness(RtCreateOrExtendTableRRP(RR'((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR_s$
cCs�d}|jj|ddddddg�|jj|idd6d d6d
d6�|jj|idd6dd6d
d6d
d6�|jj|idd6dd6d
d6dd6�|jj|ddgditjd�d6�}|jt|�d|�|j|dd|dd|�|j|dd|dd|�|jj|ddgditj d�d6�}|jt|�d|�|j|ddd
|�|j|ddd|�|jj|ditj�d6tj d�d6tjd�d6tjd
�d6tjd�d6d�d6�}|jt|�d|�|j|ddd
|�|j|ddd|�dS(Nt
test_CondObjsR<R=R>R?R@tpsthe letter Asthe letter Bs
is for cookiesis for aardvarksthe letter Es
is for dogs
is for PythonRsthe liiis
%aardvark%s%letter%tissis forcSs|S(N((ts((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR2=s(
RRRR"RRWR3R4tassertNotEqualtLikeCondR#tCondRV(RR'R)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyRhsF% ## cCs�d}|jj|dddg�|jj|idd6dd6�|jj|idd6dd6d d6�|jj|d
itjd�d6�|jj|dgd
itjd�d6�}|jt|�d�dS(
Nttest_DeleteR1tytztX1tY1tX2tY2tZ2RtXi( RRRRURRWR"R3R4(RR'R)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyRoBs!(&cCsd}|jj|dddg�|jj|idd6dd6dd6�|jj|idd6d d6�|jj|id
d6dd6�d�}d
�}d�}|jj|ditjd�d6di|d6�|jj|ditjd�d6di|d6�|jj|ditjd�d6di|d6�y7|jj|ditjd�d6didd6�Wntk
r�n
Xtd�|jj |dditjd
�d6�}|jt|�d|�|j|ddd|�|j|ddd|�|jj |dditjd�d6�}|jt|�d|�|j|ddd|�|j|ddd|�|jj |dditjd�d6�}|jt|�d|�|j|ddd|�|j|ddd|�dS(Nttest_ModifytNametTypetAccesssIndex to MP3 files.doctWordt8s Nifty.MP3t1tUnknownt0cSs|dkrdS|S(NtMP3(R#(ttype((s./sys/lib/python2.7/bsddb/test/test_dbtables.pytset_type[scSstt|�d�S(Ni(tstrtint(tcount((s./sys/lib/python2.7/bsddb/test/test_dbtables.pytincrement_access`scSsdS(N(R#(tvalue((s./sys/lib/python2.7/bsddb/test/test_dbtables.pytremove_valuecsRtmappingss%MP3%t%sWhat is your quest?s.why was TypeError not raised for bad callable?iiR�t2s%doc%t9(
RRRtModifyRRVRmt TypeErrorR5R"R#R3R4(RR'R�R�R�R)((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyRxRsT!!
"(
t__name__t
__module__tdb_nameRRRR+R;RXR_RhRoRx(((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyR(s
2 K ( * cCs&tj�}|jtjt��|S(N(tunittestt TestSuitetaddTestt makeSuiteR(tsuite((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyt
test_suite�st__main__tdefaultTestR�(tosRQRRtcPickleRtImportErrorR�R
RRRRRRtTestCaseRR�R�tmain(((s./sys/lib/python2.7/bsddb/test/test_dbtables.pyt<module>s$
.�
|