
    Yfd                         d Z ddlZddlmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZmZ dd	lmZ  G d
 d          Z G d de	e          Z G d dej                  Z G d dej                  ZdS )z&
Tests for L{twisted.runner.procmon}.
    N)ProcessDoneProcessExitedAlreadyProcessTerminated)Clock)MemoryReactor)globalLogPublisher)Failure)LoggingProtocolProcessMonitor)unittestc                   :    e Zd ZdZdZdZdZ	 	 	 	 ddZd Zd Z	dS )	DummyProcessa   
    An incomplete and fake L{IProcessTransport} implementation for testing how
    L{ProcessMonitor} behaves when its monitored processes exit.

    @ivar _terminationDelay: the delay in seconds after which the DummyProcess
        will appear to exit when it receives a TERM signal
       Nr   c                     || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        d S N)
proto_reactor_executable_args_environment_path_uid_gid_usePTY	_childFDs)selfreactor
executableargsenvironmentpathr   uidgidusePTYchildFDss              R/var/www/html/env/lib/python3.11/site-packages/twisted/runner/test/test_procmon.py__init__zDummyProcess.__init__    sP     
%
'
		!    c                     | j         dfdd}| j        t                      ||v r3||         \  }}| j                            || j        |          | _        dS dS )a  
        A partial implementation of signalProcess which can only handle TERM and
        KILL signals.
         - When a TERM signal is given, the dummy process will appear to exit
           after L{DummyProcess._terminationDelay} seconds with exit code 0
         - When a KILL signal is given, the dummy process will appear to exit
           immediately with exit code 1.

        @param signalID: The signal name or number to be issued to the process.
        @type signalID: C{str}
        r   r   r   )TERMKILLN)_terminationDelaypidr   r   	callLaterprocessEnded_signalHandler)r   signalIDparamsdelaystatuss        r&   signalProcesszDummyProcess.signalProcess9   sx      115vFF8&(((v"8,ME6"&-"9"9t(&# #D r(   c                     d| _         t          t          d}| j                            t           ||         |                               dS )zC
        Deliver the process ended event to C{self.proto}.
        Nr*   )r.   r   r   r   r0   r	   )r   r5   	statusMaps      r&   r0   zDummyProcess.processEndedP   sS      
 
	 	
(9	&(9&(A(A B BCCCCCr(   )NNr   N)
__name__
__module____qualname____doc__r.   r   r-   r'   r6   r0    r(   r&   r   r      su          CE " " " "2  .	D 	D 	D 	D 	Dr(   r   c                   .    e Zd ZdZd Zdi dddddfdZdS )DummyProcessReactorz
    @ivar spawnedProcesses: a list that keeps track of the fake process
        instances built by C{spawnProcess}.
    @type spawnedProcesses: C{list}
    c                 d    t          j        |            t          j        |            g | _        d S r   )r   r'   r   spawnedProcessesr   s    r&   r'   zDummyProcessReactor.__init__c   s1    t$$$t "r(   r=   Nr   c
                     t          | |||||||||	
  
        }
|                    |
           | j                            |
           |
S )zz
        Fake L{reactor.spawnProcess}, that logs all the process
        arguments and returns a L{DummyProcess}.
        )r   makeConnectionrA   append)r   processProtocolr   r   envr!   r"   r#   r$   r%   procs              r&   spawnProcessz DummyProcessReactor.spawnProcessi   sc    " 
 
 	&&t,,,$$T***r(   )r9   r:   r;   r<   r'   rI   r=   r(   r&   r?   r?   \   sX         # # #      r(   r?   c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d"S )#ProcmonTestsz&
    Tests for L{ProcessMonitor}.
    c                     t                      | _        t          | j                  | _        d| j        _        d| j        _        d| j        _        dS )zL
        Create an L{ProcessMonitor} wrapped around a fake reactor.
        r      
   N)r?   r   r   pmminRestartDelaymaxRestartDelay	thresholdrB   s    r&   setUpzProcmonTests.setUp   sI     +,, 666"#"$r(   c                     | j                             dddgddi            t          | j                   }|                     d|           |                     d|           |                     d|           d	S )
z+
        Repr includes all details
        fooarg1arg2r   rN   r"   r#   rG   12N)rP   
addProcessreprassertInr   representations     r&   test_reprLooksGoodzProcmonTests.test_reprLooksGood   sy     	566"2qbIIIdge^,,,c>***c>*****r(   c                     | j                             dddgi            t          | j                   }|                     d|           |                     d|           dS )z
        Repr does not include unneeded details.

        Values of attributes that just mean "inherit from launching
        process" do not appear in the repr of a process.
        rV   rW   rX   )rG   ()N)rP   r\   r]   assertNotInr_   s     r&   test_simpleReprLooksGoodz%ProcmonTests.test_simpleReprLooksGood   se     	566"2;;;dgn---n-----r(   c                     | j                             dddgddi            |                     | j                                         d         dddgddi fi           dS )	zW
        The list of monitored processes must be included in the pickle state.
        rV   rW   rX   r   rN   rY   	processesN)rP   r\   assertEqual__getstate__rB   s    r&   test_getStateIncludesProcessesz+ProcmonTests.test_getStateIncludesProcesses   sx     	566"2qbIIIG  "";/%66:JAqRT9U1V	
 	
 	
 	
 	
r(   c                 `    |                      d| j                                                   dS )z~
        The private L{ProcessMonitor._reactor} instance variable should not be
        included in the pickle state.
        r   N)re   rP   rj   rB   s    r&   test_getStateExcludesReactorz)ProcmonTests.test_getStateExcludesReactor   s.    
 	TW%9%9%;%;<<<<<r(   c                    | j                             dddgddi            |                     | j         j        i            |                     | j         j        dddgddi fi           | j                                          | j                            d           |                     t          | j         j        	                                          dg           dS )	z
        L{ProcessMonitor.addProcess} only starts the named program if
        L{ProcessMonitor.startService} has been called.
        rV   rW   rX   r   rN   rY   r   N)
rP   r\   ri   	protocolsrh   startServicer   advancelistkeysrB   s    r&   test_addProcesszProcmonTests.test_addProcess   s    
 	566"2qbIII*B///*Uff5Eq!R4P,QRRRQdg/446677%AAAAAr(   c           	          | j                             dddgddi            |                     t          | j         j        dddgddi            dS )z|
        L{ProcessMonitor.addProcess} raises a C{KeyError} if a process with the
        given name already exists.
        rV   rW   rX   r   rN   rY   N)rP   r\   assertRaisesKeyErrorrB   s    r&    test_addProcessDuplicateKeyErrorz-ProcmonTests.test_addProcessDuplicateKeyError   sk    
 	566"2qbIIIdg(%&&1AqaUW 	 	
 	
 	
 	
 	
r(   c                 
   ddi}| j                                          | j                             ddgdd|           | j                            d           |                     | j        j        d         j        |           dS )	z
        L{ProcessMonitor.addProcess} takes an C{env} parameter that is passed to
        L{IReactorProcess.spawnProcess}.
        KEYvaluerV   r   rN   rY   r   N)rP   rp   r\   r   rq   ri   rA   r   )r   fakeEnvs     r&   test_addProcessEnvzProcmonTests.test_addProcessEnv   s    
 '"55'qaWEEEQ6q9FPPPPPr(   c                     | j                                          | j                             ddgd           | j                            d           |                     | j        j        d         j        d           dS )z
        L{ProcessMonitor.addProcess} takes an C{cwd} parameter that is passed
        to L{IReactorProcess.spawnProcess}.
        rV   z	/mnt/lala)cwdr   N)rP   rp   r\   r   rq   ri   rA   r   rB   s    r&   test_addProcessCwdzProcmonTests.test_addProcessCwd   sv    
 	55'{;;;Q6q9?MMMMMr(   c                 X   | j                                          | j                             ddg           |                     t	          | j         j                  d           | j                             d           |                     t	          | j         j                  d           dS )zm
        L{ProcessMonitor.removeProcess} removes the process from the public
        processes list.
        rV   r   r   N)rP   rp   r\   ri   lenrh   removeProcessrB   s    r&   test_removeProcesszProcmonTests.test_removeProcess   s    
 	55'***TW.//333e$$$TW.//33333r(   c                     | j                                          |                     t          | j         j        d           dS )zz
        L{ProcessMonitor.removeProcess} raises a C{KeyError} if the given
        process name isn't recognised.
        rV   N)rP   rp   rv   rw   r   rB   s    r&   !test_removeProcessUnknownKeyErrorz.ProcmonTests.test_removeProcessUnknownKeyError   s;    
 	(DG$95AAAAAr(   c                 ,   | j                             ddg           | j                             d           |                     | j         j        d         t
                     |                     d| j         j                                                   dS )a  
        When a process has been started, an instance of L{LoggingProtocol} will
        be added to the L{ProcessMonitor.protocols} dict and the start time of
        the process will be recorded in the L{ProcessMonitor.timeStarted}
        dictionary.
        rV   N)	rP   r\   startProcessassertIsInstancero   r
   r^   timeStartedrs   rB   s    r&   test_startProcesszProcmonTests.test_startProcess   s     	55'***U###dg/6HHHeTW0557788888r(   c                     | j                             ddg           | j                             d           |                     | j                             d                     dS )zr
        L{ProcessMonitor.startProcess} silently returns if the named process is
        already started.
        rV   N)rP   r\   r   assertIsNonerB   s    r&   test_startProcessAlreadyStartedz,ProcmonTests.test_startProcessAlreadyStarted
  s^    
 	55'***U###$'..u5566666r(   c                 R    |                      t          | j        j        d           dS )zy
        L{ProcessMonitor.startProcess} raises a C{KeyError} if the given
        process name isn't recognised.
        rV   N)rv   rw   rP   r   rB   s    r&    test_startProcessUnknownKeyErrorz-ProcmonTests.test_startProcessUnknownKeyError  s'    
 	(DG$8%@@@@@r(   c                 J   | j                                          | j                             ddg           |                     d| j         j                   dx}| j         j        d         j        _        | j                            | j         j	                   | j         
                    d           | j                            |           | j                            d           |                     | j                                        | j         j        d                    dS )zm
        L{ProcessMonitor.stopProcess} immediately sends a TERM signal to the
        named process.
        rV   r   r   N)rP   rp   r\   r^   ro   	transportr-   r   rq   rS   stopProcessri   secondsr   )r   	timeToDies     r&   "test_stopProcessNaturalTerminationz/ProcmonTests.test_stopProcessNaturalTermination  s   
 	55'***eTW./// LML	DG%e,6H 	TW.///E""" 	Y'''
 	Q 	--//1DU1KLLLLLr(   c                    | j                                          | j                             ddg           |                     d| j         j                   | j                            | j         j                   | j         j        d         j        }| j         j	        dz   |_
        | j                             d           | j                            | j         j	        dz
             |                     d| j         j        d                    | j                            d           | j                            ddg           |                     | j                                        | j         j        d                    dS )z
        L{ProcessMonitor.stopProcess} kills a process which fails to terminate
        naturally within L{ProcessMonitor.killTime} seconds.
        rV   r   g        r   N)rP   rp   r\   r^   ro   r   rq   rS   r   killTimer-   r   ri   r   pumpr   )r   rH   s     r&   test_stopProcessForcedKillz'ProcmonTests.test_stopProcessForcedKill8  sH   
 	55'***eTW.///TW.///w '1!%!1A!5E""" 	TW-1222dg1%8999Q 	1a&!!!--//1DU1KLLLLLr(   c                 R    |                      t          | j        j        d           dS )zx
        L{ProcessMonitor.stopProcess} raises a C{KeyError} if the given process
        name isn't recognised.
        rV   N)rv   rw   rP   r   rB   s    r&   test_stopProcessUnknownKeyErrorz,ProcmonTests.test_stopProcessUnknownKeyErrorU  s'    
 	(DG$7?????r(   c                     | j                             ddg           |                     | j                             d                     dS )z
        L{ProcessMonitor.stopProcess} silently returns if the named process
        is already stopped. eg Process has crashed and a restart has been
        rescheduled, but in the meantime, the service is stopped.
        rV   N)rP   r\   r   r   rB   s    r&   test_stopProcessAlreadyStoppedz+ProcmonTests.test_stopProcessAlreadyStopped\  sH     	55'***$'--e4455555r(   c                 \   g }|                      t          j        |j                   t          j        |j                   | j                            ddg           | j                                         | j        	                    d           | 
                    d| j        j                   | j        	                    | j        j                   | j        j        d                             d           |                     t          |          d           |d         d         }|d         d         }|d         d         }|d         d         }|                     |d	           |                     |d
           |                     |d           |                     |d           dS )zS
        Getting a complete output line on stdout generates a log message.
        rV   r      hello world!
r   log_namespacestreamtagline%twisted.runner.procmon.ProcessMonitorstdouthello world!N)
addCleanupr   removeObserverrE   addObserverrP   r\   rp   r   rq   r^   ro   rS   outReceivedassertEqualsr   r   events	namespacer   r   r   s         r&   test_outputReceivedCompleteLinez,ProcmonTests.test_outputReceivedCompleteLinee      *96=III&v}55555'***QeTW.///TW.///% ,,->???#f++q)))1Io.	8$Qiay )%LMMM&(+++#u%%%$/////r(   c                 \   g }|                      t          j        |j                   t          j        |j                   | j                            ddg           | j                                         | j        	                    d           | 
                    d| j        j                   | j        	                    | j        j                   | j        j        d                             d           |                     t          |          d           |d         d         }|d         d         }|d         d         }|d         d         }|                     |d	           |                     |d
           |                     |d           |                     |d           dS )zS
        Getting a complete output line on stderr generates a log message.
        rV   r   r   r   r   r   r   r   r   stderrr   N)r   r   r   rE   r   rP   r\   rp   r   rq   r^   ro   rS   errReceivedr   r   r   s         r&   !test_ouputReceivedCompleteErrLinez.ProcmonTests.test_ouputReceivedCompleteErrLine  r   r(   c                 V   g }|                      t          j        |j                   t          j        |j                   | j                            ddg           | j                                         | j        	                    d           | 
                    d| j        j                   | j        	                    | j        j                   | j        j        d                             d           |                     t          |          d           |d         }|d         }|d         }|d         }|d         }|                     |d	           |                     |d
           |                     |d           |                     |t!          d                     dS )zN
        Getting invalid UTF-8 results in the repr of the raw message
        rV   r   s   hello world!
r   r   r   r   r   r   r   s   hello world!N)r   r   r   rE   r   rP   r\   rp   r   rq   r^   ro   rS   r   r   r   r]   )r   r   messager   r   r   outputs          r&   *test_outputReceivedCompleteLineInvalidUTF8z7ProcmonTests.test_outputReceivedCompleteLineInvalidUTF8  s    *96=III&v}55555'***QeTW.///TW.///% ,,-BCCC#f++q))))O,	"en)%LMMM&(+++#u%%%&$':";";<<<<<r(   c                     g }|                      t          j        |j                   t          j        |j                   | j                            ddg           | j                                         | j        	                    d           | 
                    d| j        j                   | j        	                    | j        j                   | j        j        d                             d           |                     t          |          d           | j        j        d                             t#          t%          d                               |                     t          |          d           |d         d         }|d         d         }|d         d         }|d         d         }|                     |d	           |                     |d
           |                     |d           |                     |d           dS )zM
        Getting partial line results in no events until process end
        rV   r   s   hello world!r   r   r   r   r   r   r   r   N)r   r   r   rE   r   rP   r\   rp   r   rq   r^   ro   rS   r   r   r   r0   r	   r   r   s         r&   test_outputReceivedPartialLinez+ProcmonTests.test_outputReceivedPartialLine  s    *96=III&v}55555'***QeTW.///TW.///% ,,_===#f++q)))% --gk!nn.E.EFFF#f++q)))1Io.	8$Qiay )%LMMM&(+++#u%%%$/////r(   c                 ^   | j                             ddg           | j                                          | j                            d           |                     d| j         j                   | j                            | j         j                   | j         j        d                             t          t          d                               |                     d| j         j                   | j                            d           |                     d| j         j                   dS )z
        L{ProcessMonitor.connectionLost} should immediately restart a process
        if it has been running longer than L{ProcessMonitor.threshold} seconds.
        rV   r   N)rP   r\   rp   r   rq   r^   ro   rS   r0   r	   r   re   rB   s    r&   #test_connectionLostLongLivedProcessz0ProcmonTests.test_connectionLostLongLivedProcess  s    
 	55'***QeTW.///TW.///% --gk!nn.E.EFFF 1222QeTW./////r(   c                    | j                             ddg           | j                                          | j                            d           | j                             d           |                     d| j         j                   | j         j        d         }|                     |	                                           | j                            | j         j
        d         j        j                   |                     |	                                           |                     d| j         j                   dS )z
        L{ProcessMonitor.connectionLost} cancels a scheduled process killer and
        deletes the DelayedCall from the L{ProcessMonitor.murder} list.
        rV   r   N)rP   r\   rp   r   rq   r   r^   murder
assertTrueactivero   r   r-   assertFalsere   )r   delayedCalls     r&   test_connectionLostMurderCancelz,ProcmonTests.test_connectionLostMurderCancel  s   
 	55'***QE"""eTW^,,,gnU+**,,---TW.u5?QRRR++--.../////r(   c                    | j                                          | j                             ddg           |                     d| j         j                   | j         j        d         j                            d           | j                            | j         j        d         j        j	                   | 
                    d| j         j                   dS )z
        L{ProcessMonitor.connectionLost} removes the corresponding
        ProcessProtocol instance from the L{ProcessMonitor.protocols} list.
        rV   r,   N)rP   rp   r\   r^   ro   r   r6   r   rq   r-   re   rB   s    r&   #test_connectionLostProtocolDeletionz0ProcmonTests.test_connectionLostProtocolDeletion  s    
 	55'***eTW.///% *88@@@TW.u5?QRRR 122222r(   c                 ,   d| j         _        d| j         _        | j                                          | j                             ddg           |                     | j         j        d         | j         j                   | j                            | j         j	        dz
             | j         j
        d                             t          t          d                               |                     | j         j        d         | j         j                   dS )z}
        L{ProcessMonitor.connectionLost} will wait at least minRestartDelay s
        and at most maxRestartDelay s
        rN      rV   r   r   N)rP   rQ   rR   rp   r\   ri   r4   r   rq   rS   ro   r0   r	   r   rB   s    r&   %test_connectionLostMinMaxRestartDelayz2ProcmonTests.test_connectionLostMinMaxRestartDelay	  s    
 #$"#55'***u-tw/FGGGTW.2333% --gk!nn.E.EFFFu-tw/FGGGGGr(   c                 B   | j                                          | j                             ddg           | j                            | j         j        dz
             |                     d| j         j                   |                     | j         j	        d         | j         j
                   | j         j        d                             t          t          d                               |                     | j         j	        d         | j         j
        dz             dS )z|
        L{ProcessMonitor.connectionLost} doubles the restart delay each time
        the process dies too quickly.
        rV   r   r   rN   N)rP   rp   r\   r   rq   rS   r^   ro   ri   r4   rQ   r0   r	   r   rB   s    r&   &test_connectionLostBackoffDelayDoublesz3ProcmonTests.test_connectionLostBackoffDelayDoubles  s    
 	55'***TW.2333eTW.///u-tw/FGGG% --gk!nn.E.EFFFu-tw/F/JKKKKKr(   c                     | j                             ddg           | j                                          | j                            d           |                     d| j         j                   dS )zP
        L{ProcessMonitor.startService} starts all monitored processes.
        rV   r   N)rP   r\   rp   r   rq   r^   ro   rB   s    r&   test_startServicezProcmonTests.test_startService'  sg     	55'***QeTW./////r(   c                 d   | j                             ddg           | j                             ddg           | j                                          | j                            | j         j                   |                     d| j         j                   |                     d| j         j                   | j                            d           | j                                          | j                            | j         j	        dz              | 
                    i | j         j                   dS )zT
        L{ProcessMonitor.stopService} should stop all monitored processes.
        rV   barr   N)rP   r\   rp   r   rq   rS   r^   ro   stopServicer   ri   rB   s    r&   test_stopServicezProcmonTests.test_stopService2  s    	55'***55'***TW.///eTW.///eTW.///Q 	TW-1222TW./////r(   c                    | j                             ddg           | j                                          | j                            d           | j                                          | j                            d           t          | j        j                  }|                                }| 	                    |g            | 
                    |j                   dS )zR
        L{ProcessMonitor.restartAll} succeeds when there is one process.
        rV   r   N)rP   r\   rp   r   rq   
restartAllrr   rA   popr   r   r.   )r   rh   	myProcesss      r&   !test_restartAllRestartsOneProcessz.ProcmonTests.test_restartAllRestartsOneProcessH  s     	55'***Q 	Q677	MMOO	)R((()-(((((r(   c                    | j                             ddg           | j                                          | j                            | j         j                   |                     d| j         j                   | j                            d           | j         j        d                             t          t          d                               |                     | j         j        d                                                    | j                                          |                     | j         j        d                                                    dS )ze
        L{ProcessMonitor.stopService} should cancel any scheduled process
        restarts.
        rV   r   r   N)rP   r\   rp   r   rq   rS   r^   ro   r0   r	   r   r   restartr   r   r   rB   s    r&   test_stopServiceCancelRestartsz+ProcmonTests.test_stopServiceCancelRestartsX  s   
 	55'***TW.///eTW.///Q% --gk!nn.E.EFFF.5577888/668899999r(   c                    d| j         _        d| j         _        | j                                          | j                             ddg           | j                            d           | j                             d           | j                            d           | j                                          | j                            d           | 	                    | j         j
        i            dS )ze
        L{ProcessMonitor.stopService} should cancel all scheduled process
        restarts.
           rV   r      N)rP   rS   rQ   rp   r\   r   rq   r   r   ri   ro   rB   s    r&   (test_stopServiceCleanupScheduledRestartsz5ProcmonTests.test_stopServiceCleanupScheduledRestartsl  s    
 "#55'***QE"""QQ 	*B/////r(   N)$r9   r:   r;   r<   rT   ra   rf   rk   rm   rt   rx   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r=   r(   r&   rK   rK      s          + + +
. 
. 
.
 
 
= = =
B 
B 
B
 
 
	Q 	Q 	QN N N	4 	4 	4B B B
9 
9 
97 7 7A A AM M M<M M M:@ @ @6 6 60 0 060 0 06= = =80 0 0:0 0 0(0 0 0*
3 
3 
3H H H L L L	0 	0 	00 0 0,) ) ) : : :(0 0 0 0 0r(   rK   c                   *    e Zd ZdZd Zd Zd Zd ZdS )DeprecationTestszQ
    Tests that check functionality that should be deprecated is deprecated.
    c                 `    t                      | _        t          | j                  | _        dS )z5
        Create reactor and process monitor.
        rM   N)r?   r   r   rP   rB   s    r&   rT   zDeprecationTests.setUp  s)     +,, 666r(   c                 x   | j                             ddg           | j         j        }|                     t	          |          d           |                                 }d}|D ]/}|                     |d         t                     d|d         v rd}0|                     |dt          |                      d	S )
a   
        _Process.toTuple is deprecated.

        When getting the deprecated processes property, the actual
        data (kept in the class _Process) is converted to a tuple --
        which produces a DeprecationWarning per process so converted.
        rV   r   FcategorytoTupler   Tzno tuple deprecation found:N)
rP   r\   rh   r   r   flushWarningsassertIsDeprecationWarningr   r]   )r   myprocesseswarningsfoundToTuplewarnings        r&   test_toTuplezDeprecationTests.test_toTuple  s     	55'***g'#k**A...%%'' 	$ 	$GMM'*-/ABBBGI...#&TDNN&T&TUUUUUr(   c                 
   | j         j        }|                     |i            |                                 }|                    d          }|                     |d         t                     |                     |g            dS )a  
        Accessing L{ProcessMonitor.processes} results in deprecation warning

        Even when there are no processes, and thus no process is converted
        to a tuple, accessing the L{ProcessMonitor.processes} property
        should generate its own DeprecationWarning.
        r   r   N)rP   rh   r   r   r   r   r   )r   myProcessesr   firsts       r&   test_processeszDeprecationTests.test_processes  sz     g'+r***%%''QeJ');<<<(B'''''r(   c                     t          j        | j                   |                                 }|D ]#}|                     |d         t
                     $dS )zO
        Pickling an L{ProcessMonitor} results in deprecation warnings
        r   N)pickledumpsrP   r   r   r   )r   r   r   s      r&   test_getstatezDeprecationTests.test_getstate  sa     	TW%%'' 	C 	CGMM'*-/ABBBB	C 	Cr(   N)r9   r:   r;   r<   rT   r   r   r   r=   r(   r&   r   r     sb         7 7 7V V V&( ( (C C C C Cr(   r   )r<   r   twisted.internet.errorr   r   r   twisted.internet.taskr   twisted.internet.testingr   twisted.loggerr   twisted.python.failurer	   twisted.runner.procmonr
   r   twisted.trialr   r   r?   TestCaserK   SynchronousTestCaser   r=   r(   r&   <module>r      s     W W W W W W W W W W ' ' ' ' ' ' 2 2 2 2 2 2 - - - - - - * * * * * * B B B B B B B B " " " " " "GD GD GD GD GD GD GD GDT, , , , ,- , , ,^v0 v0 v0 v0 v08$ v0 v0 v0r6C 6C 6C 6C 6Cx3 6C 6C 6C 6C 6Cr(   