← Back
Editing: test_format.cpython-38.pyc
U �`�[#X � @ s$ d Z ddlmZmZmZ zddlmZ e W n ek rD dZY nX ddlm Z ddl mZ ddlm Z mZ dd lmZ dd lmZmZmZmZmZmZ ddlmZ G dd � d e j�ZG dd� de j�ZG dd� de j�ZG dd� de j�ZG dd� de�Z G dd� de!�Z"G dd� de j�Z#dS )z+ Test cases for L{twisted.logger._format}. � )�mktime�addTZCleanup�setTZ)�tzsetN)�unittest)�SkipTest)�_PY3�unicode� )�LogLevel)�formatEvent�formatUnformattableEvent� formatTime�formatEventAsClassicLogText�formatWithCall�eventAsText)�Failurec @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dS )�FormattingTestsz5 Tests for basic event formatting functions. c s� � fdd�}� � d|d�� � � d|d�� � � d|ddd�� � � d|d d dd� d �� � � d|d�� |d�}� �d|� |ddd�}ts�� �d|� n� �d|� ttd��}� �d| d |ddd�� dS )ag 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{unicode}, and if given bytes, will always treat its format string as UTF-8 encoded. c s$ | |d<