%PDF- %PDF-
Direktori : /opt/plesk/python/2.7/lib64/python2.7/test/ |
Current File : //opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyo |
� 5}�ac @ sp d d l m Z d d l Z d d l Z d d l Z d e j f d � � YZ d � Z e d k rl e � n d S( i����( t test_supportNt DummyThreadingTestCasec B s3 e Z d e j f d � � YZ d � Z d � Z RS( t TestThreadc B s e Z d � Z RS( c C s� d } t j r* d G| j Gd G| Gd GHn t j � t j � t d 7a t j r] t Gd GHn t j � t j | � t j r� d G| j Gd GHn t j � t d 8a t j r� | j Gd Gt Gd GHn t j � t j � d S( Ni t tasks will run fort seci s tasks are runningt dones is finished.( R t verboset namet semat acquiret mutext runningt releaset timet sleep( t selft delay( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyt run s$ ( t __name__t __module__R ( ( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyR s c C s: d | _ t j d d � a t j � a d a g | _ d S( Ni t valuei i ( t numtaskst _threadingt BoundedSemaphoreR t RLockR R t threads( R ( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyt setUp$ s c C s� xG t | j � D]6 } | j d d | � } | j j | � | j � q Wt j r[ d GHn x | j D] } | j � qe Wt j r� d GHn d S( NR s <thread %d>s! waiting for all tasks to completes all tasks done( t rangeR R R t appendt startR R t join( R t it t( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyt test_tasks. s ( R R R t ThreadR R R! ( ( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyR s c C s t j t � d S( N( R t run_unittestR ( ( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyt test_main; s t __main__( t testR t unittestt dummy_threadingR R t TestCaseR R$ R ( ( ( sB /opt/plesk/python/2.7/lib64/python2.7/test/test_dummy_threading.pyt <module> s 5