|
Server : LiteSpeed System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : idnco5810 ( 1093) PHP Version : 8.2.29 Disable Function : NONE Directory : /lib/python3/dist-packages/twisted/logger/test/__pycache__/ |
Upload File : |
o
�b�% � @ s� d Z ddlZddlmZ ddlmZmZmZ zddlm Z W n e
y) dZ Y nw ddlmZ ddl
mZmZmZmZ dd lmZ dd
lmZ G dd� dej�ZdS )
z+
Test cases for L{twisted.logger._format}.
� N)�count)�Any�Callable�Optional)�tzset)�unittest� )�KeyFlattener�
aFormatter�extractField�flattenEvent)�formatEvent)�LogEventc @ s� e Zd ZdZd"dd�Zd"dd�Zd"dd �Zd"d
d�Z d#dee de fd
d�Z
d"dd�Zd"dd�Zd"dd�Z
dd� fdee ge f ddfdd�Zd"dd�Zd"dd�Zd"dd�Zd"d d!�ZdS )$�FlatFormattingTestsz9
Tests for flattened event formatting functions.
�returnNc sr t � � G dd� d�}td� fdd�|� dddd �}t|� t|�}|d
= |d= t�t�|��}| �t|�d� d
S )a)
L{flattenEvent} will "flatten" an event so that, if scrubbed of all but
serializable objects, it will preserve all necessary data to be
formatted once serialized. When presented with an event thusly
flattened, L{formatEvent} will produce the same output.
c @ s e Zd ZdZdS )z;FlatFormattingTests.test_formatFlatEvent.<locals>.Ephemeral�valueN)�__name__�
__module__�__qualname__� attribute� r r �B/usr/lib/python3/dist-packages/twisted/logger/test/test_flatten.py� Ephemeral% s r z�callable: {callme()} attribute: {object.attribute} numrepr: {number!r} numstr: {number!s} strrepr: {string!r} unistr: {unistr!s}c s t � �S �N)�nextr ��counterr r �<lambda>1 s z:FlatFormattingTests.test_formatFlatEvent.<locals>.<lambda>� �hello� ö)�
log_format�callme�object�number�string�unistrr"