%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/logger/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/logger/test/__pycache__/test_util.cpython-312.pyc |
� Ϫ�f� � �r � d Z ddlmZ ddlmZ ddlmZmZ ddlm Z ddl mZ G d� d ej � Z y )z) Test cases for L{twisted.logger._util}. � )�implementer)�unittest� )�ILogObserver�LogEvent)�LogPublisher)�formatTracec � � e Zd ZdZdd�Zdd�Zy)� UtilTestsz Utility tests. Nc � � ������ t � �t g �� �t t � dt ddfd�� �t t � dt ddf����� fd�� �t t � dt ddf������ fd�� ��j �� �j �� �j �� ��� y)zJ Tracing keeps track of forwarding done by the publisher. �� log_trace�e�returnNc � � y �N� �r s �?/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 �����r r z UtilTests.test_trace.<locals>.o2! s9 �� ��M�M�!�U�#�����+����O���O�� r c �f �� �j | �� �j | d ��f��f��fg� y r r )r r r r �o3r r! s ������r r# z UtilTests.test_trace.<locals>.o3- s@ �� ��M�M�!�U�#�����+����O���O���O�� r )r �dictr r r �addObserver)r! r r r r# r s `@@@@@r � test_tracezUtilTests.test_trace s� �� � !�N� ���,�� �\� "� �(� �t� � #� � �\� "� �(� �t� � � #� � �\� "� �(� �t� � � #� � ���b�!����b�!����b�!��%�r c � � �� � t g �� �t t � dt ddfd�� }t t � dt ddfd�� }t t � dt ddfd�� }t t � dt ddfd�� }t t � dt ddfd �� }d |_ d|_ d|_ d |_ d|_ t t � dt ddf�� � fd�� }|}t |� }t |||� } d|_ d| _ t || ||� } d| _ d}|j | |||||| ||�� � | �� y)z) Format trace as string. r r r Nc � � y r r r s r r z&UtilTests.test_formatTrace.<locals>.o1D r r c � � y r r r s r r z&UtilTests.test_formatTrace.<locals>.o2H r r c � � y r r r s r r# z&UtilTests.test_formatTrace.<locals>.o3L r r c � � y r r r s r �o4z&UtilTests.test_formatTrace.<locals>.o4P r r c � � y r r r s r �o5z&UtilTests.test_formatTrace.<locals>.o5T r r zroot/o1z root/p1/o2z root/p1/o3z root/p1/p2/o4zroot/o5c �j �� �j | �� t | d � }�j |�� y r )r r r )r �tracer � expectedTracer! s ���r �testObserverz0UtilTests.test_formatTrace.<locals>.testObserver` s/ �� ��M�M�!�U�#���+��/�E����U�M�2r zroot/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} ) �rootr r r# r, r. �p1�p2�oTest)r$ r r r �namer �format)r! r r r# r, r. r2 r6 r5 r4 r3 �expectedTraceTemplater r1 s ` @@r �test_formatTracezUtilTests.test_formatTrace>