Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.16.48.82
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_recno.pyc
�
A��cc@s�dZddlZddlZddlZddlmZddlZddlZddlmZm	Z	m
Z
mZmZdej
fd��YZd�Zedkr�ejd	d
�ndS(s%TestCases for exercising a Recno DB.
i����N(tpprint(tdbttest_supporttverbosetget_new_environment_pathtget_new_database_pathtSimpleRecnoTestCasecBs�eZejdks3ejd
krNejdkrNdd�Zdd�Znd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(iiiicCs|jt|�|d|�S(Ntmsg(tassertEqualttype(tselftobjtdatatypeR((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pytassertIsInstancescCs|j||d|�S(NR(tassertGreaterEqual(R
tatbR((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyRscCst�|_d|_dS(N(RtfilenametNonethomeDir(R
((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pytsetUpscCs0tj|j�|jr,tj|j�ndS(N(RtunlinkRRtrmtree(R
((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyttearDowns	c
Cs�tj�}|jd�}|j|�|j|jtjtj�xQtjD]F}|j	|d�}|j
|t�|j|d�t
rN|GqNqNWt
r�Hn|j�}t
r�t|�nxbtdt|�d�D]G}||}t
r�|GHn|j
|t�|j||j|��q�Wy|d}Wngtjk
r�}tjdkrr|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
rR}|rc|jd	�qcnX|j|d�|j �}t
r}|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$|rSt
rD|GHn|j+�}q0W|j,d�|j-�}t
r{|GHn|j.ddtj/�|j,d�|j-�}|j|d�t
r�|GHn|j0d�}t
r�|GHn|j0d�}|j|d�t
r|GHn|j1�|j1�tj�}|j|j�|j)�}d|d<|j|dd�y|d}Wntk
r�nX|jd�y|jd�Wn}tj2k
r+}|r�|jd�qBtjdkr|j|dtj3�n|j|jdtj3�t
rB|GHqBnX|sB|jd�n|j,d�}x$|rwt
rh|GHn|j+�}qTW|j1�|j1�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(4RtDBtset_get_returns_nonetopenRtDB_RECNOt	DB_CREATEtstringt
ascii_letterstappendR
tintRRtstatRtrangetlentstrRtgettDBInvalidArgErrortsystversion_infotEINVALtargstfailthas_keytDBErrortKeyErrortDBNotFoundErrorRtkeystlisttitemsttuplet
assertTruetassertFalsetdeletetget_bothtfdtcursortfirsttnexttsettcurrenttputt
DB_CURRENTt	set_rangetclosetDBKeyEmptyErrortDB_KEYEMPTY(
R
tdtget_returns_nonetxtrecnoR"tdatatvalR1R3R9tctrec((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyttest01_basic!s�

 






	






	
cCs!t�}||_tjj|d�}tjj|�sItj|�nt|d�}|j�t	j
�}|jd�|jd�|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�dj��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</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyttest02_WithSource�sT		













cCshtj�}|jd�|jd�|jd�|j|jtjtj�x"tj	D]}|j
|d�qYW|j
dd�y|j
dd�Wngtjk
r}tj
dkr�|j|d
tj�n|j|jd
tj�tr|GHqnX|jd�|j�}|j�}x$|rOtr@|GHn|j�}q,W|j�|j�dS(
Ni(t-i-i#t.tbadiiiisexpected exception(ii(RRt
set_re_lent
set_re_padRRRRRRR R'R(R)RR*R+RR,R:R;R<RB(R
RERGRJRKRL((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyttest03_FixedLength	s2



	
cCs�tj�}|j|jdtjdtj�|jd�}|jd|jd|��|jd�}|jd|jd|��dS(Ntdbtypetflagst itkeyti(	RRRRRRR Rtget_size(R
REtrow_id((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyttest04_get_size_empty*s"(ii(ii(iiN(
t__name__t
__module__R(R)RR
RRRRMR`RfRn(((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyRs			�	>	!cCs
tjt�S(N(tunittestt	makeSuiteR(((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyt
test_suite:st__main__tdefaultTestRs(t__doc__RQR(terrnoRRRqttest_allRRRRRtTestCaseRRsRotmain(((s</usr/local/python-2.7/lib/python2.7/bsddb/test/test_recno.pyt<module>s(�,	
© 2025 GrazzMean