Current File : //opt/imh-python/lib/python2.7/test/test_dumbdbm.pyo
�
��Wc@s�dZddlZddlZddlZddlmZejZd�Zdej	fd��YZ
d�Zedkr�e�ndS(	sATest script for the dumbdbm module
   Original by Roger E. Masse
i����N(ttest_supportcCsGx@dddgD]/}ytjt|�Wqtk
r>qXqWdS(Ns.dirs.dats.bak(tostunlinkt_fnametOSError(text((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyt
_delete_filess

tDumbDBMTestCasecBseZidd6dd6dd6dd6dd	6d
d6dd
6Zd�Zd�Zejeed�d�ejeed�d�d���Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�ZRS("tt0sPython:tatProgrammingtbtthetctwaytdtGuidotftintendedtgcGstjj||�dS(N(tunittesttTestCaset__init__(tselftargs((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyRscCshtjtd�}|j|j�g�x"|jD]}|j|||<q2W|j|�|j�dS(NR(tdumbdbmtopenRtassertEqualtkeyst_dicttread_helpertclose(RRtkey((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_dumbdbm_creation s
tchmodsos.chmod not availabletumasksos.umask not availablecCs�z2tjd�}tjtdd�}|j�Wdtj|�Xd}tjdkrad}nddl}tjtd�}|j|j	|j
�|�tjtd	�}|j|j	|j
�|�dS(
NiRi�i�tposixi�i����s.dats.dir(RR$RRRR tnametstatRtS_IMODEtst_mode(Rt	old_umaskRt
expected_modeR'tst((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_dumbdbm_creation_mode(s	cCsEtjt�}d|d<|j|dd�|j�|j�dS(NRR
(RRRRR (RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_close_twice>s


cCsL|j�tjtd�}d|jd<|d<|j|�|j�dS(NtwtindentedR(tinit_dbRRRRRR (RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_dumbdbm_modificationEs


cCs7|j�tjtd�}|j|�|j�dS(Ntr(R1RRRRR (RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_dumbdbm_readLs

cCs6|j�tjt�}|j|�}|j�dS(N(R1RRRtkeys_helperR (RRR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_dumbdbm_keysRs
cCs^tjt�}d|d<d|d<|j�tjt�}|j|dd�|j�dS(Nthellot1thello2(RRRR R(RR((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_write_write_readXs


cCs�tjt�}d|d<d|d<|j�ttd�j�}|jdd�}ttdd�j|�tjt�}|j|dd�|j|dd�dS(	NR7R8R9t2s.dirs
s
twb(RRRR treadtreplacetwriteR(RRtdata((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_line_endingsbs


cCsB|j|�}x,|jD]!}|j|j|||�qWdS(N(R5RR(RRRR!((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyRtscCsEtjtd�}x"|jD]}|j|||<qW|j�dS(NR/(RRRRR (RRtk((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyR1yscCsC|j�}|j�|jj�}|j�|j||�|S(N(RtsortRR(RRRtdkeys((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyR5s

c	Cs7ddl}i}xtd�D]}tjt�}x�td�D]�}|jd�}|j�dkr�||kr�||=||=q�qA|jd�|jd�}|||<|||<|j|||�qAW|j�tjt�}|j	�}|j
�|j	�}|j
�|j||�|j�qWdS(Ni����iidt
abcdefghijklmg�������?tabci'(trandomtrangeRRRtchoicet	randrangeRR titemsRC(	RRGRtdummyRRBtvtexpectedtgot((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttest_random�s,





cCs�ttdd��}|jd�WdQXtj��F}|jt��tjt�j�WdQX|j	|j
�d�WdQXdS(Ns.dirR/s2str(__import__('sys').stdout.write('Hacked!')), 0
R(RRR?Rtcaptured_stdouttassertRaisest
ValueErrorRR Rtgetvalue(Rtstreamtstdout((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyt	test_eval�scCst�dS(N(R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyttearDown�scCst�dS(N(R(R((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pytsetUp�s(t__name__t
__module__RRR"Rt
skipUnlessthasattrRR-R.R2R4R6R:RARR1R5RPRWRXRY(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyRs0

		'					
				
			cCs ztjt�Wdt�XdS(N(Rtrun_unittestRR(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyt	test_main�st__main__(
t__doc__RRRttestRtTESTFNRRRRR_RZ(((sj/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dumbdbm.pyt<module>s		�