File: //usr/lib/python3/dist-packages/twisted/logger/test/__pycache__/test_format.cpython-310.pyc
o
�bU � @ s0 d Z ddlmZmZmZ z
ddlmZ e W n ey! dZY nw ddlm Z ddl
mZmZm
Z
ddlmZ ddlmZ d d
lmZmZmZmZmZmZ d dlmZ d dlmZ G d
d� dej�ZG dd� dej�ZG dd� dej�Z G dd� dej�Z!G dd� d�Z"G dd� de#�Z$G dd� dej�Z%dS )z+
Test cases for L{twisted.logger._format}.
� )�AnyStr�Optional�cast)�tzsetN)�Failure)�addTZCleanup�mktime�setTZ)�unittest)�SkipTest� )�eventAsText�formatEvent�formatEventAsClassicLogText�
formatTime�formatUnformattableEvent�formatWithCall)�LogEvent)�LogLevelc @ sV e Zd ZdZddd�Zddd�Zddd �Zdd
d�Zddd
�Zddd�Z ddd�Z
dS )�FormattingTestsz5
Tests for basic event formatting functions.
�returnNc s� dt dtdtf� fdd�}� �d|d�� � �d|d�� � �d|d dd
�� � �d|dd
dd� d�� � �d|d�� � �d|d�� |ddd�}� �d|� ttd��}� �d| d |ddd�� dS )ac
L{formatEvent} will format an event according to several rules:
- A string with no formatting instructions will be passed straight
through.
- PEP 3101 strings will be formatted using the keys and values of
the event as named fields.
- PEP 3101 keys ending with C{()} will be treated as instructions
to call that key (which ought to be a callable) before
formatting.
L{formatEvent} will always return L{str}, and if given bytes, will
always treat its format string as UTF-8 encoded.
� logFormat�eventr c s$ | |d<