File: //lib/python3/dist-packages/twisted/protocols/haproxy/test/__pycache__/test_parser.cpython-310.pyc
o
�b � @ s� d Z ddlmZmZ ddlmZmZmZmZ m
Z
mZ ddlm
Z
ddlmZ ddlmZ ddlmZ G d d
� d
e�ZG dd� de�Zd
S )z1
Tests for L{twisted.protocols.haproxy._parser}.
� )�Type�Union)�TCP4ServerEndpoint�TCP6ServerEndpoint�UNIXServerEndpoint�_parse�_WrapperServerEndpoint�serverFromString)�
MemoryReactor)�SynchronousTestCase� )�unparseEndpoint)�HAProxyWrappingFactoryc @ s^ e Zd ZdZdeddfdd�Zddd�Zdd d
�Zddd�Zdd
d�Z ddd�Z
ddd�ZdS )�UnparseEndpointTestszg
Tests to ensure that un-parsing an endpoint string round trips through
escaping properly.
�input�returnNc C s | � tt|�� |� dS )aA
Check that the input unparses into the output, raising an assertion
error if it doesn't.
@param input: an input in endpoint-string-description format. (To
ensure determinism, keyword arguments should be in alphabetical
order.)
@type input: native L{str}
N)�assertEqualr
�
parseEndpoint)�selfr � r �L/usr/lib/python3/dist-packages/twisted/protocols/haproxy/test/test_parser.py�check s
zUnparseEndpointTests.checkc C � | � d� dS )z%
An individual word.
�wordN�r �r r r r �test_basicUnparse) � z&UnparseEndpointTests.test_basicUnparsec C r )z%
Multiple arguments.
zone:twoNr r r r r �test_multipleArguments/ r z+UnparseEndpointTests.test_multipleArgumentsc C r )z$
Keyword arguments.
zaleph=one:bet=twoNr r r r r �
test_keywords5 r z"UnparseEndpointTests.test_keywordsc C r )z
Escaped ":".
zhello\:colon\:worldNr r r r r �test_colonInArgument; r z)UnparseEndpointTests.test_colonInArgumentc C r )z/
Escaped ":" in keyword value.
zhello=\:Nr r r r r �test_colonInKeywordValueA r z-UnparseEndpointTests.test_colonInKeywordValuec C r )z.
Escaped ":" in keyword name.
z\:=helloNr r r r r �test_colonInKeywordNameG r z,UnparseEndpointTests.test_colonInKeywordName�r N)�__name__�
__module__�__qualname__�__doc__�strr r r r r r! r"