Current File : //opt/imh-python/lib/python2.7/test/test_dummy_thread.pyc |
�
��Wc @ s� d Z d d l a d d l Z d d l Z d d l Z d d l Z d d l m Z d a d e j
f d � � YZ d e j
f d � � YZ d e j
f d
� � YZ
d d � Z e d k r� 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.
i����N( t test_supporti t LockTestsc B s_ e 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 j � | _ d S( N( t _threadt
allocate_lockt lock( t self( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt setUp s c C s | j | j j � d � d S( Ns( Lock object is not initialized unlocked.( t assertFalseR t locked( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt
test_initlock s c C s7 | j j � | j j � | j | j j � d � d S( Ns% Lock object did not release properly.( R t acquiret releaseR R ( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt test_release s
c C s | j t j | j j � d S( N( t assertRaisesR t errorR R ( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt test_improper_release% s c C s | j | j j d � d � d S( Ni s) Conditional acquiring of the lock failed.( t
assertTrueR R
( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt test_cond_acquire_success) s c C s0 | j j d � | j | j j d � d � d S( Ni s= Conditional acquiring of a locked lock incorrectly succeeded.( R R
R ( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt test_cond_acquire_fail. s c C s* | j j � | j | j j � d � d S( Ns Uncondional locking failed.( R R
R R ( R ( ( so /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_dummy_thread.pyt test_uncond_acquire_success5 s
c C s<