Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/influxdb/tests/__pycache__/test_line_protocol.cpython-39.pyc
Ðазад
a p�h� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z dd l mZmZ dd l mZ G dd� dej�ZdS ) z%Define the line protocol test module.� )�absolute_import)�division)�print_function)�unicode_literalsN)�datetime)�Decimal)�UTC�timezone)� line_protocolc @ s` e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dS )�TestLineProtocolz$Define the LineProtocol test object.c C s@ dddddd�ddd d ddd�d �gd�}| � t�|�d� dS )z/Test make new lines in TestLineProtocol object.� NzC:\� �hello)Z empty_tagZnone_tagZ backslash_tagZinteger_tagZ string_tag�testzhello!� g�������?T)Z string_valZint_val� float_valZ none_fieldZbool_val��measurement�fields��tags�pointszrtest,backslash_tag=C:\\,integer_tag=2,string_tag=hello bool_val=True,float_val=1.1,int_val=1i,string_val="hello!" ��assertEqualr � make_lines��self�data� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/influxdb/tests/test_line_protocol.py�test_make_lines s( � �����z TestLineProtocol.test_make_linesc C s� t ddddddd�}t�|�}td��|�}|�td��}d d ddidd �d ddidd �d ddi|d �d ddi|d �d ddi|d �d ddi|d �gi}| �t�|�d�g d��d � dS )z)Test timezone in TestLineProtocol object.i� � � � r i@� z Europe/Berlinz US/Easternr �A�valr )r r �timez2009-11-10T23:00:00.123456Z� )z A val=1i 0�A val=1i 1257894000123456000r( r( �A val=1i 1257890400123456000r) N) r r Zlocalizer � astimezoner r r �join)r �dt�utcZberlinZeasternr r r r � test_timezone3 s. ������zTestLineProtocol.test_timezonec C s* ddddid�gi}| � t�|�d� dS )z:Test string value with newline in TestLineProtocol object.r �m1Z multi_linezline1 line1 line3r z$m1 multi_line="line1\nline1\nline3" Nr r r r r �test_string_val_newlineQ s �����z(TestLineProtocol.test_string_val_newlinec C s0 ddidddid�gd�}| � t�|�d� d S ) z3Test make unicode lines in TestLineProtocol object.Zunicode_tagu 'Привет!'r Zunicode_valu Привет!r r u= test,unicode_tag='Привет!' unicode_val="Привет!" Nr r r r r �test_make_lines_unicodec s ������z(TestLineProtocol.test_make_lines_unicodec C s* ddddid�gi}| � t�|�d� dS )z+Test make lines with an empty string field.r r �stringr r ztest string="" Nr r r r r �"test_make_lines_empty_field_stringx s �����z3TestLineProtocol.test_make_lines_empty_field_stringc C s0 ddidddid�gd�}| � t�|�d� d S ) z0Test make lines with tag value contains newline.�t1zline1 line2r r% r r r z!test,t1=line1\nline2 val="hello" Nr r r r r �test_tag_value_newline� s ������z'TestLineProtocol.test_tag_value_newlinec C s | � t�d�d� dS )z2Test quote indentation in TestLineProtocol object.� \foo ' bar " Örfu "\\foo ' bar \" Örf"N)r r Zquote_ident�r r r r �test_quote_ident� s �z!TestLineProtocol.test_quote_identc C s | � t�d�d� dS )z.Test quote literal in TestLineProtocol object.r6 u '\\foo \' bar " Örf'N)r r Z quote_literalr7 r r r �test_quote_literal� s �z#TestLineProtocol.test_quote_literalc C s* ddddid�gi}| � t�|�d� dS )z?Ensure precision is preserved when casting floats into strings.r r r g �?r z"test float_val=1.0000000000000009 Nr r r r r �%test_float_with_long_decimal_fraction� s ���� �z6TestLineProtocol.test_float_with_long_decimal_fractionc C s. dddt d�id�gi}| �t�|�d� dS )z@Ensure precision is preserved when casting Decimal into strings.r r r g:Ŷ��?r z"test float_val=0.8289445733333332 N)r r r r r r r r �5test_float_with_long_decimal_fraction_as_type_decimal� s ���� �zFTestLineProtocol.test_float_with_long_decimal_fraction_as_type_decimalN)�__name__� __module__�__qualname__�__doc__r r. r0 r1 r3 r5 r8 r9 r: r; r r r r r s r )r? � __future__r r r r Zunittestr �decimalr Zpytzr r Zinfluxdbr ZTestCaser r r r r �<module> s
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка