%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/names/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_tap.cpython-312.pyc |
� Ϫ�f� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZm Z ddlmZ dd lmZ dd lmZ G d� de� Zy )z! Tests for L{twisted.names.tap}. � )�ThreadedResolver)�Resolver)�PORT)� ResolverChain)�SecondaryAuthorityService)�Options�_buildResolvers)�platform)� UsageError)�SynchronousTestCasec �8 � e Zd ZdZdd�Zdd�Zdd�Zdd�Zdd�Zy) �OptionsTestszf Tests for L{Options}, defining how command line arguments for the DNS server are parsed. Nc �0 � t � }| j t |j ddg� | j t |j ddg� | j t |j ddg� | j t |j ddg� y)z� If the value supplied for an I{--secondary} option does not provide a server IP address, optional port number, and domain name, L{Options.parseOptions} raises L{UsageError}. �--secondary� �1.2.3.4z 1.2.3.4:helloz1.2.3.4:hello/example.comN)r �assertRaisesr �parseOptions��self�optionss �=/usr/lib/python3/dist-packages/twisted/names/test/test_tap.py�test_malformedSecondaryz$OptionsTests.test_malformedSecondary s� � � �)�����*�g�&:�&:�]�B�<O�P����*�g�&:�&:�]�I�<V�W������,�,�}�o�.N� � ����� � � �7�8� � c � � t � }|j ddg� | j dt fdgfg|j � y)z� An argument of the form C{"ip/domain"} is parsed by L{Options} for the I{--secondary} option and added to its list of secondaries, using the default DNS port number. r z1.2.3.4/example.comr �example.comN)r r �assertEqualr �secondariesr s r �test_secondaryzOptionsTests.test_secondary+ sD � � �)�����m�-B�C�D����I�t�,�}�o�>�?��AT�AT�Ur c �~ � t � }|j ddg� | j ddgfg|j � y)z� An argument of the form C{"ip:port/domain"} can be used to specify an alternate port number for which to act as a secondary. r �1.2.3.4:5353/example.com)r �� r N)r r r r r s r �test_secondaryExplicitPortz'OptionsTests.test_secondaryExplicitPort5 s@ � � �)�����m�-G�H�I����,�}�o�>�?��AT�AT�Ur c �0 � t � }|j g d�� | j t |j � d� |j d }| j |j d t � | j |j d� | j |j d� |j d }| j |j d t � | j |j d� | j |j d� y ) z� After parsing I{--secondary} options, L{Options} constructs a L{SecondaryAuthorityService} instance for each configured secondary. )r r! r z1.2.3.5:5354/example.com� r r r"