Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
test
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/test/test_dummy_thread.pyc
mò ‚=5Dc�����������@���s¹���d��Z��d�k�a�d�k�Z�d�k�Z�d�k�Z�d�k�Z�d�k�l�Z�d�a �d�e�i �f�d�„��ƒ��YZ�d�e�i �f�d�„��ƒ��YZ�d�e�i �f�d �„��ƒ��YZ �d�d �„�Z�e�d�j�o�e�ƒ��n�d�S(���sÕ���Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. N(���s���test_supporti����t ���LockTestsc�����������B���s_���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �d�„��Z �d �„��Z�RS( ���s���Test lock objects.c���������C���s���t��i�ƒ��|��_�d��S(���N(���t���_threadt ���allocate_lockt���selft���lock(���R���(����(����t,���/usr/lib/python2.4/test/test_dummy_thread.pyt���setUp���s����c���������C���s���|��i�|��i�i�ƒ��d�ƒ�d��S(���Ns(���Lock object is not initialized unlocked.(���R���t ���failUnlessR���t���locked(���R���(����(����R���t ���test_initlock���s����c���������C���s8���|��i�i�ƒ��|��i�i�ƒ��|��i�|��i�i�ƒ��d�ƒ�d��S(���Ns%���Lock object did not release properly.(���R���R���t���acquiret���releaseR���R���(���R���(����(����R���t���test_release���s���� c���������C���s���|��i�t�i�|��i�i�ƒ�d��S(���N(���R���t���failUnlessRaisesR���t���errorR���R���(���R���(����(����R���t���test_improper_release%���s����c���������C���s ���|��i�|��i�i�d�ƒ�d�ƒ�d��S(���Ni����s)���Conditional acquiring of the lock failed.(���R���R���R���R ���(���R���(����(����R���t���test_cond_acquire_success)���s����c���������C���s1���|��i�i�d�ƒ�|��i�|��i�i�d�ƒ�d�ƒ�d��S(���Ni����s=���Conditional acquiring of a locked lock incorrectly succeeded.(���R���R���R ���R���(���R���(����(����R���t���test_cond_acquire_fail.���s����c���������C���s*���|��i�i�ƒ��|��i�|��i�i�ƒ��d�ƒ�d��S(���Ns���Uncondional locking failed.(���R���R���R ���R���R���(���R���(����(����R���t���test_uncond_acquire_success5���s���� c���������C���s&���|��i�|��i�i�d�ƒ�t�j�d�ƒ�d��S(���Ni���s*���Unconditional locking did not return True.(���R���R���R���R ���t���True(���R���(����(����R���t���test_uncond_acquire_return_val;���s����c���������C���s©���d�„��}�|��i�i�ƒ��t�t�i�ƒ��ƒ�}�t�i�|�|��i�t �f�ƒ�t �i�o�Hd�t �GHn�|��i�i�ƒ��t�t�i�ƒ��ƒ�}�t �i�o �d�GHn�|��i �|�|�t �j�d�ƒ�d��S(���Nc���������C���s���t��i�|�ƒ�|��i�ƒ��d�S(���s:���Hold on to lock for a set amount of time before unlocking.N(���t���timet���sleept���delayt ���to_unlockR���(���R���R���(����(����R���t���delay_unlockB���s����� s@���*** Waiting for thread to release the lock (approx. %s sec.) ***t���dones+���Blocking by unconditional acquiring failed.(���R���R���R���R ���t���intR���t ���start_timeR���t���start_new_threadt���DELAYt���test_supportt���verboset���end_timeR���(���R���R!���R���R���(����(����R���t���test_uncond_acquire_blocking@���s���� (���t���__name__t ���__module__t���__doc__R���R ���R���R���R���R���R���R���R"���(����(����(����R���R�������s���� t ���MiscTestsc�����������B���s;���t��Z�d��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���s���Miscellaneous tests.c���������C���s���|��i�t�t�i�ƒ�d��S(���N(���R���R ���t ���SystemExitR���t���exit(���R���(����(����R���t ���test_exitX���s����c���������C���s?���|��i�t�t�i�ƒ��t�ƒ�d�ƒ�|��i�t�i�ƒ��d�j�d�ƒ�d��S(���Ns*���_thread.get_ident() returned a non-integeri����s���_thread.get_ident() returned 0(���R���R���t ���isinstanceR���t ���get_identR���(���R���(����(����R���t ���test_ident\���s����c���������C���s&���|��i�t�t�i�ƒ��t�i�ƒ�d�ƒ�d��S(���NsR���_thread.LockType is not an instance of what is returned by _thread.allocate_lock()(���R���R���R*���R���R���t���LockType(���R���(����(����R���t ���test_LockTypec���s����c���������C���s)���d�„��}�|��i�t�t�i�|�t�ƒ��ƒ�d��S(���Nc�����������C���s���t��i�ƒ��d��S(���N(���R���t���interrupt_main(����(����(����R���t���call_interruptl���s����(���R0���R���R ���t���KeyboardInterruptR���R���t���tuple(���R���R0���(����(����R���t���test_interrupt_maini���s���� c���������C���s���|��i�t�t�i�ƒ�d��S(���N(���R���R ���R1���R���R/���(���R���(����(����R���t���test_interrupt_in_mainq���s����(���R#���R$���R%���R)���R,���R.���R3���R4���(����(����(����R���R&���U���s���� t���ThreadTestsc�����������B���s ���t��Z�d��Z�d�„��Z�d�„��Z�RS(���s���Test thread creation.c���������C���s��t��t��d�„�}�t�i�d�ƒ�}�t�i�|�|�t�t�f�ƒ�|�i�ƒ��}�|��i �|�d�o�|�d�d�ƒ�t�i�|�t�ƒ��h��d�|�<d�t�<d�t�<ƒ�|�i�ƒ��}�|��i �|�d�o�|�d�d�ƒ�t�i�|�|�t�f�h��d�t�<ƒ�|�i�ƒ��}�|��i �|�d�o�|�d�d �ƒ�d��S( ���Nc���������C���s���|��i�|�|�f�ƒ�d�S(���s<���Use to test _thread.start_new_thread() passes args properly.N(���t���queuet���putt���arg1t���arg2(���R6���R8���R9���(����(����R���t ���arg_tester{���s�����i���i����s7���Argument passing for thread creation using tuple failedR6���R8���R9���s8���Argument passing for thread creation using kwargs failedsG���Argument passing for thread creation using both tuple and kwargs failed(���t���FalseR:���t���Queuet ���testing_queueR���R���R���t���gett���resultR���R���R2���(���R���R:���R?���R=���(����(����R���t���test_arg_passingy���s����1"c���������C���sÙ���d�„��}�d�}�t�i�|�ƒ�}�t�i�o�Hd�t�|�f�GHn�xP�t�|�ƒ�D]B�}�t�o�t �t �i �ƒ��d�ƒ�}�n�d�}�t�i �|�|�|�f�ƒ�qI�Wt�i�t�ƒ�t�i�o �d�GHn�|��i�|�i�ƒ��|�j�d�|�t�f�ƒ�d��S(���Nc���������C���s$���t��i�|�ƒ�|��i�t�i�ƒ��ƒ�d�S(���s@���Wait for ``delay`` seconds and then put something into ``queue``N(���R���R���R���R6���R7���R���R+���(���R6���R���(����(����R���t ���queue_mark‘���s����� i���sJ���*** Testing multiple thread creation (will take approx. %s to %s sec.) ***i���i����R���s2���Not all %s threads executed properly after %s sec.(���RA���t���thread_countR<���R=���R���R ���R���t���xranget���countt���roundt���randomt���local_delayR���R���R���R���R���R���t���qsize(���R���RA���RB���RD���RG���R=���(����(����R���t���test_multi_creation���s$���� � (���R#���R$���R%���R@���RI���(����(����(����R���R5���v���s���� c���������C���sF���|��o�|��a�d�a�n�t�i�o�Hd�t�GHn�t�i�t�t�t�ƒ�d��S(���Ni���s"���*** Using %s as _thread module ***( ���t���imported_moduleR���R���R���R ���t���run_unittestR����R&���R5���(���RJ���(����(����R���t ���test_mainª���s����� t���__main__(���R%���t���dummy_threadR���R���R<���RF���t���unittestt���testR���R���t���TestCaseR����R&���R5���t���NoneRL���R#���( ���R���RO���RF���R5���R<���RL���R&���R���R����(����(����R���t���?���s��� C!4