| Server IP : 159.223.102.202 / Your IP : 216.73.216.195 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/twisted/test/__pycache__/ |
Upload File : |
�
M��e� � �6 � d Z ddlmZ ddlmZ G d� de� Zy)z&
Tests for L{twisted.python.context}.
� )�context)�SynchronousTestCasec �( � e Zd ZdZd� Zd� Zd� Zd� Zy)�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 ddit 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_setByCallzContextTests.test_setByCall s) � �
������s�C�j�'�+�+�s�C�S�Ir c �~ � t j ddid� � | 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
dt 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_setDefaultzContextTests.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