��Qc@s�dZddlZddlZddlmZddlZddlmZmZmZdej fd��YZ
d�Zedkr�ej
d d
�ndS(s&
TestCases for exercising a Queue DB.
i�N(tpprint(tdbtverbosetget_new_database_pathtSimpleQueueTestCasecBs,eZd�Zd�Zd�Zd�ZRS(cCst�|_dS(N(Rtfilename(tself((s+/sys/lib/python2.7/bsddb/test/test_queue.pytsetUpscCs/ytj|j�Wntjk
r*nXdS(N(tostremoveRterror(R((s+/sys/lib/python2.7/bsddb/test/test_queue.pyttearDownscCs{tr%dGddGHd|jjGHntj�}|jd�|j|jtjtj �tr�dddGHt
|j��nx"tj
D]}|j|d�q�W|jt|�ttj
��|jdd �|jd
d�|jdd
�|jdd�|jt|�ttj
�d�trMdddGHt
|j��n|j�~tj�}|j|j�tr�dddGHt
|j��n|jdd�|jddd�|j�}tr�ddGHt
|j��n|j�}x$|r#tr|GHn|j�}qW|j�trTdddGHt
|j��n|jt|�dd�|j�dS(Ns
s-=isRunning %s.test01_basic...i(sbefore appendst-idssome more dataiesand some more iKsout of orderisreplacement dataisbefore closes
after opensone moresanother onettxnsafter appendsafter consume loopiskif you see this message then you need to rebuild Berkeley DB 3.1.17 with the patch in patches/qam_stat.diff(Rt __class__t__name__RtDBt
set_re_lentopenRtDB_QUEUEt DB_CREATERtstattstringtletterstappendtassertEqualtlentputtclosetNonetcursortconsume(Rtdtxtctrec((s+/sys/lib/python2.7/bsddb/test/test_queue.pyttest01_basicsZ
#
cCs6tr%dGddGHd|jjGHntj�}|jd�|j|jtjtj �tr�dddGHt
|j��nx"tj
D]}|j|d�q�W|jt|�ttj
��|jdd �|jd
d�|jdd
�|jdd�|jt|�ttj
�d�trMdddGHt
|j��n|j�~tj�}|j|j�tr�dddGHt
|j��n|jd�tr�dddGHt
|j��n|j�}x$|rtr�GHn|j�}q�Wtr(dddGHt
|j��n|j�dS(Ns
s-=is Running %s.test02_basicPost32...i(sbefore appendsRidssome more dataiesand some more iKsout of orderisreplacement dataisbefore closes
after opensone moresafter appendsafter consume loop(RRRRRRRRRRRRRRRRRRRR(RR R!R#((s+/sys/lib/python2.7/bsddb/test/test_queue.pyttest02_basicPost32^sP
#
(Rt
__module__RRR$R%(((s+/sys/lib/python2.7/bsddb/test/test_queue.pyR
s FcCs
tjt�S(N(tunittestt makeSuiteR(((s+/sys/lib/python2.7/bsddb/test/test_queue.pyt
test_suite�st__main__tdefaultTestR)(t__doc__RRRR'ttest_allRRRtTestCaseRR)Rtmain(((s+/sys/lib/python2.7/bsddb/test/test_queue.pyt<module>s�
|