File: //usr/lib/python3/dist-packages/twisted/logger/test/__pycache__/test_flatten.cpython-38.pyc
U
W[�# � @ s� d Z ddlmZ ddlZzddlmZ e W n ek
rD dZY nX ddlmZ ddl m
Z
ddlmZm
Z
mZmZ G d d
� d
ej�ZdS )z+
Test cases for L{twisted.logger._format}.
� )�countN)�tzset)�unittest� )�formatEvent)�flattenEvent�extractField�KeyFlattener�
aFormatterc @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zddd�Zd
d� Z dd� Z
dd� Zdd� fdd�Zdd� Z
dd� Zdd� Zdd� Zd
S ) �FlatFormattingTestsz9
Tests for flattened event formatting functions.
c st t � � G dd� dt�}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__Z 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 �Zcounterr r �<lambda>6 � z:FlatFormattingTests.test_formatFlatEvent.<locals>.<lambda>� �hello� ö)�
log_format�callme�object�number�stringZunistrr r uM callable: 0 attribute: value numrepr: 7 numstr: 7 strrepr: 'hello' unistr: öN) r r �dictr �json�loads�dumps�assertEqualr )�selfr �event1�event2Zevent3r r r �test_formatFlatEvent! s&