+
    Dfj                         R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt  ! R
 R]4      tR# )z!
Tests for L{twisted.names.tap}.
)ThreadedResolver)Resolver)PORT)ResolverChain)SecondaryAuthorityService)Options_buildResolvers)platform)
UsageError)SynchronousTestCasec                   ~   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	Rt
V tR# )OptionsTestszZ
Tests for L{Options}, defining how command line arguments for the DNS server
are parsed.
c                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "=/usr/lib/python3/dist-packages/twisted/names/test/test_tap.py__annotate__OptionsTests.__annotate__   s     
 
 
    c                2   \        4       pV P                  \        VP                  RR.4       V P                  \        VP                  RR.4       V P                  \        VP                  RR.4       V P                  \        VP                  RR.4       R# )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:helloz1.2.3.4:hello/example.comN)r   assertRaisesr
   parseOptionsselfoptionss   & r   test_malformedSecondary$OptionsTests.test_malformedSecondary   s     )*g&:&:]B<OP*g&:&:]I<VW,,}o.N	
 	  78	
r   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r   +   s     V V Vr   c                    \        4       pVP                  RR.4       V P                  R\        3R.3.VP                  4       R# )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   z1.2.3.4/example.comr   example.comN)r   r   assertEqualr   secondariesr   s   & r   test_secondaryOptionsTests.test_secondary+   sD     )m-BCDIt,}o>?ATATUr   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r   5   s     V VD Vr   c                    \        4       pVP                  RR.4       V P                  RR.3.VP                  4       R# )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.comr&   N)r     )r   r   r'   r(   r   s   & r   test_secondaryExplicitPort'OptionsTests.test_secondaryExplicitPort5   s@    
 )m-GHI,}o>?ATATUr   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r   >   s     0 0 0r   c                R   \        4       pVP                  . RO4       V P                  \        VP                  4      ^4       VP                  ^ ,          pV P                  VP                  ^ ,          \        4       V P                  VP                  R4       V P                  VP                  R4       VP                  ^,          pV P                  VP                  ^,          \        4       V P                  VP                  R4       V P                  VP                  R4       R# )z
After parsing I{--secondary} options, L{Options} constructs a
L{SecondaryAuthorityService} instance for each configured secondary.
r   r.   z1.2.3.5i  N)r   r-   r   z1.2.3.5:5354/example.com)	r   r   r'   lensvcsassertIsInstancer   primary_port)r    r!   	secondarys   &  r   test_secondaryAuthorityServices,OptionsTests.test_secondaryAuthorityServices>   s    
 )	
 	W\\*A.LLO	gll1o/HI**I6$/LLO	gll1o/HI**I6$/r   c                   < V ^8  d   QhRR/# r   r   )r   r   s   "r   r   r   V   s      5  5T  5r   c                N   \        4       pVP                  . RO4       \        V4      w  r#V F`  p\        V\        4      '       g   K  VP
                  R,          p\        V\        4      '       g   KF  VP                  P                  4        Kb  	  \        P                  ! 4       R8w  d^   ^ RIHp VP                   FG  pV P                  VP                  P                   \"        P$                  4       VP                  4        KI  	  V P'                  VR,          \        4       R# )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
posix)reactorN)z--hosts-filez	hosts.txtz--recursive)r   r   r   
isinstancer   	resolversr   
_parseCallcancelr	   getTypetwisted.internetr>   _newTimedCallsr'   func__func__r   _cleanupr5   )r    r!   caclxrecurserr>   s   &      r   test_recursiveConfiguration(OptionsTests.test_recursiveConfigurationV   s     )IJ ) A!]++;;r?h11''..0	  ( 1++  2B2K2KL
 , 	bfm4r   r   N)__name__
__module____qualname____firstlineno____doc__r"   r)   r/   r9   rN   __static_attributes____classdictcell__)r   s   @r   r   r      s@     

 
$V VV V0 00 5  5r   r   N)rT   twisted.internet.baser   twisted.names.clientr   twisted.names.dnsr   twisted.names.resolver   twisted.names.secondaryr   twisted.names.tapr   r   twisted.python.runtimer	   twisted.python.usager
   twisted.trial.unittestr   r   r   r   r   <module>r`      s6    3 ) " / = 6 + + 6c5& c5r   