
    \d                     >    d Z ddlmZ ddlmZ  G d de          ZdS )z&
Tests for L{twisted.python.context}.
    )context)SynchronousTestCasec                   *    e Zd ZdZd Zd Zd Zd ZdS )ContextTestszH
    Tests for the module-scope APIs for L{twisted.python.context}.
    c                 T    |                      t          j        d                     dS )zt
        Arbitrary keys which have not been set in the context have an associated
        value of L{None}.
        xN)assertIsNoner   getselfs    9lib/python3.11/site-packages/twisted/test/test_context.pytest_notPresentIfNotSetz$ContextTests.test_notPresentIfNotSet   s(    
 	'+c**+++++    c                 r    |                      t          j        ddit          j        d          d           dS )z
        Values may be associated with keys by passing them in a dictionary as
        the first argument to L{twisted.python.context.call}.
        r   yN)assertEqualr   callr
   r   s    r   test_setByCallzContextTests.test_setByCall   s4    
 	sCj'+sCCSIIIIIr   c                     t          j        ddid            |                     t          j        d                     dS )z
        After a L{twisted.python.context.call} completes, keys specified in the
        call are no longer associated with the values from that call.
        r   r   c                      d S )N r   r   r   <lambda>z2ContextTests.test_unsetAfterCall.<locals>.<lambda>%   s     r   N)r   r   r	   r
   r   s    r   test_unsetAfterCallz ContextTests.test_unsetAfterCall    s@    
 	c3Z...'+c**+++++r   c                     t                      }|                     t          j        j        |d           t          j        |d           |                     dt          j        |                     dS )zy
        A default value may be set for a key in the context using
        L{twisted.python.context.setDefault}.
        Nr   )object
addCleanupr   defaultContextDictpop
setDefaultr   r
   )r   keys     r   test_setDefaultzContextTests.test_setDefault(   sb    
 hh26TBBB3$$$gk#../////r   N)__name__
__module____qualname____doc__r   r   r   r!   r   r   r   r   r      s]         , , ,J J J, , ,0 0 0 0 0r   r   N)r%   twisted.pythonr   twisted.trial.unittestr   r   r   r   r   <module>r(      sj    
 # " " " " " 6 6 6 6 6 6#0 #0 #0 #0 #0& #0 #0 #0 #0 #0r   