Ë
    oj¸  ã                   ó6   — d Z ddlmZ ddlmZ  G d„ de«      Zy)z&
Tests for L{twisted.python.context}.
é    )Úcontext)ÚSynchronousTestCasec                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)ÚContextTestszH
    Tests for the module-scope APIs for L{twisted.python.context}.
    c                 óL   — | j                  t        j                  d«      «       y)zt
        Arbitrary keys which have not been set in the context have an associated
        value of L{None}.
        ÚxN)ÚassertIsNoner   Úget©Úselfs    ú;/usr/lib/python3/dist-packages/twisted/test/test_context.pyÚtest_notPresentIfNotSetz$ContextTests.test_notPresentIfNotSet   s   € ð
 	×Ñœ'Ÿ+™+ cÓ*Õ+ó    c                 ór   — | j                  t        j                  ddit        j                  d«      d«       y)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   s)   € ð
 	×ÑœŸ™ s¨C j´'·+±+¸sÓCÀSÕIr   c                 ó~   — t        j                  ddid„ «       | j                  t        j                  d«      «       y)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                   ó   — y )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-   € ô
 	�‰�c˜3�Z¡Ô.Ø×Ñœ'Ÿ+™+ cÓ*Õ+r   c                 óä   — t        «       }| j                  t        j                  j                  |d«       t        j
                  |d«       | j                  dt        j                  |«      «       y)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(   sP   € ô
 ‹hˆØ�‰œ×2Ñ2×6Ñ6¸¸TÔBÜ×Ñ˜3 Ô$Ø×Ñ˜œgŸk™k¨#Ó.Õ/r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r!   r   r   r   r   r      s   „ ñò,òJò,ó0r   r   N)r%   Útwisted.pythonr   Útwisted.trial.unittestr   r   r   r   r   ú<module>r(      s   ðñõ
 #Ý 6ô#0Ð&õ #0r   