Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/names/test/__pycache__/ |
Upload File : |
o �b� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZm Z ddlmZ dd lmZ dd lmZ G dd� de�Zd S )z! Tests for L{twisted.names.tap}. � )�ThreadedResolver)�Resolver)�PORT)� ResolverChain)�SecondaryAuthorityService)�Options�_buildResolvers)�platform)� UsageError)�SynchronousTestCasec @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) �OptionsTestszf Tests for L{Options}, defining how command line arguments for the DNS server are parsed. c C sZ t � }| �t|jddg� | �t|jddg� | �t|jddg� | �t|jddg� dS )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�options� r �=/usr/lib/python3/dist-packages/twisted/names/test/test_tap.py�test_malformedSecondary s ��z$OptionsTests.test_malformedSecondaryc C s2 t � }|�ddg� | �dtfdgfg|j� dS )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 r r r �test_secondary+ s zOptionsTests.test_secondaryc C s. t � }|�ddg� | �ddgfg|j� dS )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 r r r �test_secondaryExplicitPort5 s z'OptionsTests.test_secondaryExplicitPortc C s� t � }|�g d�� | �t|j�d� |jd }| �|jd t� | �|jd� | �|jd� |jd }| �|jd t� | �|jd� | �|jd� d S ) 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 � z1.2.3.5i� N) r r r �len�svcs�assertIsInstancer �primary�_port)r r � secondaryr r r �test_secondaryAuthorityServices>