+
    Dfj                         R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	H
t
HtHtHt ^ RIHtHtHtHtHtHt ^ RIHt ^ RIHt  ! R R	]4      t ! R
 R]4      tR# )z$
Tests for L{twisted.names.common}.
)verifyClass)	IResolver)ResolverBase)EFORMATENAMEENOTIMPEREFUSEDESERVERQuery)DNSFormatErrorDNSNameErrorDNSNotImplementedErrorDNSQueryRefusedErrorDNSServerErrorDNSUnknownError)Failure)SynchronousTestCasec                   N   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	tV tR
# )ExceptionForCodeTestsz-
Tests for L{ResolverBase.exceptionForCode}.
c                8    \        4       P                  V n        R # N)r   exceptionForCodeselfs   &@/usr/lib/python3/dist-packages/twisted/names/test/test_common.pysetUpExceptionForCodeTests.setUp   s     , ? ?    c                X    V P                  V P                  \        4      \        4       R# )zL
L{ResolverBase.exceptionForCode} converts L{EFORMAT} to
L{DNSFormatError}.
N)assertIsr   r   r   r   s   &r   test_eformat"ExceptionForCodeTests.test_eformat"       
 	d++G4nEr   c                X    V P                  V P                  \        4      \        4       R# )zL
L{ResolverBase.exceptionForCode} converts L{ESERVER} to
L{DNSServerError}.
N)r   r   r	   r   r   s   &r   test_eserver"ExceptionForCodeTests.test_eserver)   r"   r   c                X    V P                  V P                  \        4      \        4       R# )zH
L{ResolverBase.exceptionForCode} converts L{ENAME} to L{DNSNameError}.
N)r   r   r   r   r   s   &r   
test_ename ExceptionForCodeTests.test_ename0   s     	d++E2LAr   c                X    V P                  V P                  \        4      \        4       R# )zT
L{ResolverBase.exceptionForCode} converts L{ENOTIMP} to
L{DNSNotImplementedError}.
N)r   r   r   r   r   s   &r   test_enotimp"ExceptionForCodeTests.test_enotimp6   s    
 	d++G46LMr   c                X    V P                  V P                  \        4      \        4       R# )zS
L{ResolverBase.exceptionForCode} converts L{EREFUSED} to
L{DNSQueryRefusedError}.
N)r   r   r   r   r   s   &r   test_erefused#ExceptionForCodeTests.test_erefused=   s    
 	d++H57KLr   c                `    V P                  V P                  \        4       4      \        4       R# )zZ
L{ResolverBase.exceptionForCode} converts any other response code to
L{DNSUnknownError}.
N)r   r   objectr   r   s   &r   
test_other ExceptionForCodeTests.test_otherD   s    
 	d++FH5Gr   )r   N)__name__
__module____qualname____firstlineno____doc__r   r    r$   r'   r*   r-   r1   __static_attributes____classdictcell____classdict__s   @r   r   r      s:     @FFBNMH Hr   r   c                   <   a  ] tR t^Lt o RtR tR tR tR tRt	V t
R# )
QueryTestsz"
Tests for L{ResolverBase.query}.
c                .    \        \        \        4       R# )z6
L{ResolverBase} provides the L{IResolver} interface.
N)r   r   r   r   s   &r   "test_resolverBaseProvidesIResolver-QueryTests.test_resolverBaseProvidesIResolverQ   s     	I|,r   c                   a . o\        4       pRV3R l/Vn        \        RRR7      pVP                  V^{4       V P	                  R.S4       R# )z
L{ResolverBase.query} looks up a method to invoke using the type of the
query passed to it and the C{typeToMethod} mapping on itself.
90  c                 (   < SP                  W34      # r   )append)querytimeoutresultss   &&r   <lambda>6QueryTests.test_typeToMethodDispatch.<locals>.<lambda>_   s    '..%9I*Jr      example.comnametypeN)rJ   {   )r   typeToMethodr
   rE   assertEqual)r   resolverrE   rG   s   &  @r   test_typeToMethodDispatch$QueryTests.test_typeToMethodDispatchW   sQ    
 >J!
 >6uc"/0':r   c                   a \        4       o\        4       pRV3R l/Vn        \        RRR7      pVP	                  V^{4      p. pVP                  VP                  4       V P                  SV^ ,          4       R# )z
L{ResolverBase.query} returns a L{Deferred} which fires with the result
of the method found in the C{typeToMethod} mapping for the type of the
query passed to it.
i1  c                    < S# r    )rE   rF   expecteds   &&r   rH   4QueryTests.test_typeToMethodResult.<locals>.<lambda>m   s    xr   rJ   rK   N)r0   r   rO   r
   rE   addBothrD   rP   )r   rQ   rE   queryDeferredresultrW   s   &    @r   test_typeToMethodResult"QueryTests.test_typeToMethodResulte   sh     8>!&(G H>6 uc2fmm,6!9-r   c                   \        4       p/ Vn        \        RRR7      pVP                  V^{4      p. pVP	                  VP
                  4       V P                  V^ ,          \        4       V^ ,          P                  \        4       R# )z
L{ResolverBase.query} returns a L{Deferred} which fails with
L{NotImplementedError} when called with a query of a type not present in
its C{typeToMethod} dictionary.
rJ   rB   rK   N)
r   rO   r
   rE   rY   rD   assertIsInstancer   trapNotImplementedError)r   rQ   rE   rZ   r[   s   &    r   test_unknownQueryType QueryTests.test_unknownQueryTypet   sk      > ">6 uc2fmm,fQi1q	*+r   rV   N)r3   r4   r5   r6   r7   r?   rR   r\   rb   r8   r9   r:   s   @r   r=   r=   L   s#     -;., ,r   r=   N)r7   zope.interface.verifyr   twisted.internet.interfacesr   twisted.names.commonr   twisted.names.dnsr   r   r   r   r	   r
   twisted.names.errorr   r   r   r   r   r   twisted.python.failurer   twisted.trial.unittestr   r   r=   rV   r   r   <module>rk      sJ   
 . 1 - O O  + 6/H/ /Hd5,$ 5,r   