Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZddlZddlmZmZmZmZddlmZdej	fd��YZ
de
fd��YZd	e
fd
��YZde
fd��YZ
d
�Zedkr�ejdd�ndS(s(TestCases for distributed transactions.
i�N(tdbttest_supporttget_new_environment_pathtget_new_database_path(tverbosetDBTxn_distributedcBsPeZdZeZeZd�Zd�Zd�Z	d�Z
d�Zd�ZRS(i�cCsLtj�|_|jj|j�|jj|jd�|jj|jd�|jj|jd�|jr�|jj	tj
t�n|jj|j
tjtjBtjBtjBtjBtjBtjBd�tj|j�|_|jjtj�|rH|jj�}|jj|jtjtjtjBdd|�|j�ndS(Nii�ttxn(RtDBEnvtdbenvt
set_tx_maxtnum_txnstset_lk_max_lockerstset_lk_max_lockstset_lk_max_objectstnosynct	set_flagst
DB_TXN_NOSYNCtTruetopenthomeDirt	DB_CREATEt	DB_THREADt
DB_RECOVERtDB_INIT_TXNtDB_INIT_LOGt
DB_INIT_MPOOLtDB_INIT_LOCKtDBt
set_re_lentDB_GID_SIZEt	txn_begintfilenametDB_QUEUEtcommit(tselftmust_open_dbR((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt_create_envs$	)cCs%t�|_d|_|jdt�S(NttestR#(RRRR$R(R"((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pytsetUp's	cCsM|jstj�d dkr/|jj�n|jj�|jj�dS(Niii(ii(RRtversionRt	log_flushtclose(R"((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt_destroy_env,s
cCs|j�tj|j�dS(N(R*RtrmtreeR(R"((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyttearDown2s
cCs|j�|j|�dS(N(R*R$(R"R#((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt
_recreate_env6s
cCs�t�}d�}ddl}|jddkr=d�}nxt|j�D]n}|jj�}dtj}|||�}|jj	||d|dtj
�|j|�|j|�qMW~|j
|j�|jj�}|j|jt|��x'|D]\}}|j||k�qW~~|j
|j�|jj�}|j|jt|��t�}t�}	d}
x�|D]�\}}|
dks�|
d	kr�|	j|�|j�nE|
d
kr�|j�n,|
dkr|j�|j|�d}
n|
d	7}
q�W~~|j
|j�|jj�}|jt|�t|��x|D]\}}|j�qZW~~|j
dt�|jj�}|jt|�dk�|jt|	�|jj�d�dS(
NcSs|S(N((tx((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt<lambda><si�iicSs
t|d�S(Ntascii(tbytes(R.((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyR/?ss%%%ddRtflagsiiR#tnkeys(tsettsystversion_infotxrangeR
RRRRtputt	DB_APPENDtaddtprepareR-R#ttxn_recovertassertEqualtlent
assertTrueR!taborttdiscardRtstat(R"ttxnstadaptR5tiRtgidtrecovered_txnstdiscard_txnstcommitted_txnststate((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyttest01_distributed_transactions:sd		
"
		




	(
t__name__t
__module__R
RRtFalseR#R$R&R*R,R-RK(((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyRs					tDBTxn_distributedSYNCcBseZeZRS((RLRMRNR(((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyRO�stDBTxn_distributed_must_open_dbcBseZeZRS((RLRMRR#(((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyRP�st"DBTxn_distributedSYNC_must_open_dbcBseZeZeZRS((RLRMRNRRR#(((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyRQ�scCs�tj�}tj�dkrM|jtjt��|jtjt��ntj�dkr�|jtjt��|jtjt	��n|S(Niii(ii(ii(
tunittestt	TestSuiteRR'taddTestt	makeSuiteRRORPRQ(tsuite((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt
test_suite�st__main__tdefaultTestRW(t__doc__tosRRttest_allRRRRRtTestCaseRRORPRQRWRLtmain(((s>/sys/lib/python2.7/bsddb/test/test_distributed_transactions.pyt<module>s"r	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.