%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/logger/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/logger/test/__pycache__/test_util.cpython-312.pyc

�

Ϫ�f���r�dZddlmZddlmZddlmZmZddlm	Z	ddl
mZGd�d	ej�Z
y
)z)
Test cases for L{twisted.logger._util}.
�)�implementer)�unittest�)�ILogObserver�LogEvent)�LogPublisher)�formatTracec� �eZdZdZdd�Zdd�Zy)�	UtilTestsz
    Utility tests.
    Nc��������t��tg���tt�dtddfd���tt�dtddf�����fd���tt�dtddf������fd����j���j���j�����y)zJ
        Tracing keeps track of forwarding done by the publisher.
        ��	log_trace�e�returnNc��y�N��rs �?/usr/lib/python3/dist-packages/twisted/logger/test/test_util.py�o1z UtilTests.test_trace.<locals>.o1����c�`���j|���j|d��f��fg�y�Nr��assertIs�assertEqual)r�eventr�o2�	publisher�selfs �����rrz UtilTests.test_trace.<locals>.o2!s9����M�M�!�U�#�����+����O���O��
rc�f���j|���j|d��f��f��fg�yrr)rrrr�o3r r!s ������rr#z UtilTests.test_trace.<locals>.o3-s@����M�M�!�U�#�����+����O���O���O��
r)r�dictrrr�addObserver)r!rrrr#r s`@@@@@r�
test_tracezUtilTests.test_traces����!�N�	���,��	�\�	"�	�(�	�t�	�
#�	�
�\�	"�		�(�		�t�		�		�
#�		�
�\�	"�		�(�		�t�		�		�
#�		�	���b�!����b�!����b�!��%�rc����
�tg���tt�dtddfd��}tt�dtddfd��}tt�dtddfd��}tt�dtddfd��}tt�dtddfd	��}d
|_d|_d|_d
|_d|_tt�dtddf��
�fd��}|}t|�}t|||�}	d|_d|	_t||	||�}
d|
_d}|j
|
||||||	||��	�
|
��y)z)
        Format trace as string.
        r
rrNc��yrrrs rrz&UtilTests.test_formatTrace.<locals>.o1Drrc��yrrrs rrz&UtilTests.test_formatTrace.<locals>.o2Hrrc��yrrrs rr#z&UtilTests.test_formatTrace.<locals>.o3Lrrc��yrrrs r�o4z&UtilTests.test_formatTrace.<locals>.o4Prrc��yrrrs r�o5z&UtilTests.test_formatTrace.<locals>.o5Trrzroot/o1z
root/p1/o2z
root/p1/o3z
root/p1/p2/o4zroot/o5c�j���j|��t|d�}�j|��yr)rr	r)r�tracer�
expectedTracer!s  ���r�testObserverz0UtilTests.test_formatTrace.<locals>.testObserver`s/����M�M�!�U�#���+��/�E����U�M�2rzroot/p1/p2/zroot/p1/zroot/z�{root} ({root.name})
  -> {o1} ({o1.name})
  -> {p1} ({p1.name})
    -> {o2} ({o2.name})
    -> {o3} ({o3.name})
    -> {p2} ({p2.name})
      -> {o4} ({o4.name})
  -> {o5} ({o5.name})
  -> {oTest}
)	�rootrrr#r,r.�p1�p2�oTest)r$rrr�namer�format)r!rrr#r,r.r2r6r5r4r3�expectedTraceTemplaterr1s`           @@r�test_formatTracezUtilTests.test_formatTrace>s������,��	�\�	"�	�(�	�t�	�
#�	�
�\�	"�	�(�	�t�	�
#�	�
�\�	"�	�(�	�t�	�
#�	�
�\�	"�	�(�	�t�	�
#�	�
�\�	"�	�(�	�t�	�
#�	����������!������
�\�	"�	3�H�	3��	3�
#�	3�
��
�"�
��
�"�b�"�
%���������B��B��.����	�
�	� .�4�4����������5�

�
�	
�U�r)rN)�__name__�
__module__�__qualname__�__doc__r&r:rrrrrs���'�RMrrN)r>�zope.interfacer�
twisted.trialr�_interfacesrr�	_observerr�_utilr	�TestCaserrrr�<module>rEs/���'�"�0�$��{��!�!�{r

Zerion Mini Shell 1.0