+
    üÐj¢  ã                   óœ  € R t ^ RIt^ RIHt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IHtHtHtHtH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! ^ RI"H#t# ^ RI$H%t% ^ RI&H't' ]#PP                  ! 4       '       g   Rt)MRt) ! R R]4      t* ! R R4      t+ ! R R4      t, ! R R]'PZ                  4      t. ! R R]'PZ                  ]4      t/ ! R R]'PZ                  4      t0 ! R R ]'PZ                  4      t1 ! R! R"]'PZ                  4      t2 ! R# R$4      t3 ! R% R&]'PZ                  4      t4 ! R' R(]'PZ                  4      t5R# ))z)
Test cases for L{twisted.names.client}.
N)ÚverifyClassÚverifyObject)Údefer)ÚCannotListenErrorÚConnectionRefusedError)Ú	IResolver)ÚClock)ÚAlternateReactor)ÚcacheÚclientÚdnsÚerrorÚhosts)ÚResolverBase)ÚDNSQueryTimeoutError)Ú	test_util)ÚGoodTempPathMixin)Úfailure)ÚFilePath)Úplatform)Úproto_helpers)Úunittestz:These tests need more work before they'll work on Windows.c                   ó&   a € ] tR t^#t o R tRtV tR# )ÚFakeResolverc                ó   € VR8X  dA   \         P                  ! V\         P                  V^<\         P                  ! R^<R7      R7      pM\         P                  ! WV^<R7      pV.p. p. p\        P
                  ! WgV34      # )z“
The getHostByNameTest does a different type of query that requires it
return an A record from an ALL_RECORDS lookup, so we accommodate that
here.
ó   getHostByNameTestú	127.0.0.1)ÚaddressÚttl)ÚnameÚtypeÚclsr   Úpayload)r   r    r!   r   )r   ÚRRHeaderÚAÚRecord_Ar   Úsucceed)	Úselfr   r!   ÚqtypeÚtimeoutÚrrÚresultsÚ	authorityÚ
additionals	   &&&&&    Ú@/usr/lib/python3/dist-packages/twisted/names/test/test_client.pyÚ_lookupÚFakeResolver._lookup$   sr   € ð Ð'Ô'Ü—’ØÜ—U‘UØØÜŸš¨[¸bÔAô‰Bô —’ 4¸À"ÔEˆBà�$ˆØˆ	Øˆ
Ü�}Š}˜g°*Ð=Ó>Ð>ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r/   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r.   r   r   #   s   ø‡ € ÷?ð ?r1   r   c                   ó.   a € ] tR t^;t o RtRtR tRtV tR# )ÚStubPortzÑ
A partial implementation of L{IListeningPort} which only keeps track of
whether it has been stopped.

@ivar disconnected: A C{bool} which is C{False} until C{stopListening} is
    called, C{True} afterwards.
Fc                ó   € R V n         R# )TN©Údisconnected©r'   s   &r.   ÚstopListeningÚStubPort.stopListeningF   s
   € Ø ˆÖr1   r>   N)	r3   r4   r5   r6   Ú__doc__r?   rA   r7   r8   r9   s   @r.   r<   r<   ;   s   ø‡ € ñð €L÷!ð !r1   r<   c                   ó4   a € ] tR t^Jt o RtR tRR ltRtV tR# )ÚStubDNSDatagramProtocolzº
L{dns.DNSDatagramProtocol}-alike.

@ivar queries: A C{list} of tuples giving the arguments passed to
    C{query} along with the L{defer.Deferred} which was returned from
    the call.
c                ó2   € . V n         \        4       V n        R # ©N©Úqueriesr<   Ú	transportr@   s   &r.   Ú__init__Ú StubDNSDatagramProtocol.__init__S   ó   € ØˆŒÜ!›ˆŽr1   Nc                ól   € \         P                  ! 4       pV P                  P                  WW4V34       V# )z^
Record the given arguments and return a Deferred which will not be
called back by this code.
)r   ÚDeferredrI   Úappend)r'   r   rI   r)   ÚidÚresults   &&&&& r.   ÚqueryÚStubDNSDatagramProtocol.queryW   s.   € ô
 —’Ó!ˆØ�‰×Ñ˜W¨w¸FÐCÔDØˆr1   ©rI   rJ   ©é
   N)	r3   r4   r5   r6   rC   rK   rS   r7   r8   r9   s   @r.   rE   rE   J   s   ø‡ € ñò$÷ò r1   rE   c                   ó4   a € ] tR t^at o Rt]tR tR tRt	V t
R# )ÚGetResolverTestsz"
Tests for L{client.getResolver}.
c                óÜ   € \        \        4       4      ;_uu_ 4        \        P                  ! 4       pRRR4       V P	                  \        \        X4      4       R#   + '       g   i     L1; i)zA
L{client.getResolver} returns an object providing L{IResolver}.
N)r	   r   r   ÚgetResolverÚ
assertTruer   r   ©r'   Úresolvers   & r.   Útest_interfaceÚGetResolverTests.test_interfaceh   s@   € ô œe›g×&Õ&Ü×)Ò)Ó+ˆH÷ 'à�‰œ¤Y°Ó9Ö:÷ '×&ús   œAÁA+	c                óì   € \        \        4       4      ;_uu_ 4        \        P                  ! 4       p\        P                  ! 4       pRRR4       V P	                  XX4       R#   + '       g   i     L$; i)zV
Multiple calls to L{client.getResolver} return the same L{IResolver}
implementation.
N)r	   r   r   r[   ÚassertIs)r'   ÚaÚbs   &  r.   Útest_idempotentÚ GetResolverTests.test_idempotentp   sK   € ô
 œe›g×&Õ&Ü×"Ò"Ó$ˆAÜ×"Ò"Ó$ˆA÷ 'ð 	�‰�a˜Ö÷ '×&ús   œ+A#Á#A3	r2   N)r3   r4   r5   r6   rC   ÚwindowsSkipÚskipr_   re   r7   r8   r9   s   @r.   rY   rY   a   s    ø‡ € ñð €Dò;÷ð r1   rY   c                   ód   a € ] tR t^{t o Rt]tR tR tR t	R t
R tR tR tR	 tR
 tR tRtV tR# )ÚCreateResolverTestsz%
Tests for L{client.createResolver}.
c                ó  € VP                    Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P	                  ^\        V4      4       V P	                  V^ ,          P                  V4       R# u upi ©é   N)Ú	resolversÚ
isinstancer   ÚResolverÚassertEqualÚlenÚfile©r'   r^   ÚfilenameÚrÚress   &&&  r.   Ú
_hostsTestÚCreateResolverTests._hostsTest‚   s_   € Ø"×,Ò,ÓNÑ,�Q´
¸1¼e¿n¹n×0M�qˆqÑ,ˆÐNØ×Ñ˜œC ›HÔ%Ø×Ñ˜˜Q�Ÿ™ hÖ/ùò Oó
   �"A>¶A>c                óÂ   € \        \        4       4      ;_uu_ 4        \        P                  ! 4       pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)z˜
L{client.createResolver} returns a L{resolve.ResolverChain} including a
L{hosts.Resolver} using I{/etc/hosts} if no alternate hosts file is
specified.
Ns
   /etc/hosts©r	   r   r   ÚcreateResolverrx   r]   s   & r.   Útest_defaultHostsÚ%CreateResolverTests.test_defaultHosts‡   s;   € ô œe›g×&Õ&Ü×,Ò,Ó.ˆH÷ 'à�‰˜ -Ö0÷ '×&úó   œAÁA	c                óÆ   € \        \        4       4      ;_uu_ 4        \        P                  ! RR7      pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)z—
The I{hosts} parameter to L{client.createResolver} overrides the hosts
file used by the L{hosts.Resolver} in the L{resolve.ResolverChain} it
returns.
ó   /foo/bar)r   Nr|   r]   s   & r.   Útest_overrideHostsÚ&CreateResolverTests.test_overrideHosts‘   s=   € ô œe›g×&Õ&Ü×,Ò,°;Ô?ˆH÷ 'à�‰˜ +Ö.÷ '×&úó   œAÁA 	c                ó  € VP                    Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P	                  ^\        V4      4       V P	                  V^ ,          P                  V4       R# u upi )zd
Verify that C{resolver} has a L{client.Resolver} with a configuration
filename set to C{filename}.
N)rn   ro   r   rp   rq   rr   Úresolvrt   s   &&&  r.   Ú_resolvConfTestÚ#CreateResolverTests._resolvConfTest›   sa   € ð
 #×,Ò,ÓOÑ,�Q´
¸1¼f¿o¹o×0N�qˆqÑ,ˆÐOØ×Ñ˜œC ›HÔ%Ø×Ñ˜˜Q�Ÿ™¨Ö1ùò Prz   c                ó   € \        4       p\        V4      ;_uu_ 4        \        P                  ! 4       pRRR4       XP                   Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P                  ^\        V4      4       V P                  W^ ,          P                  4       R#   + '       g   i     LŒ; iu upi )z
The L{client.Resolver} included in the L{resolve.ResolverChain} returned
by L{client.createResolver} uses the global reactor.
N)r   r	   r   r}   rn   ro   rp   rq   rr   rb   Ú_reactor)r'   Úreactorr^   rv   rw   s   &    r.   Útest_reactorÚ CreateResolverTests.test_reactor¤   s‡   € ô
 “'ˆÜ˜g×&Õ&Ü×,Ò,Ó.ˆH÷ 'à"×,Ò,ÓOÑ,�Q´
¸1¼f¿o¹o×0N�qˆqÑ,ˆÐOØ×Ñ˜œC ›HÔ%Ø�‰�g 1�vŸ™Ö/÷	 '×&üâOs   žB8Á
"CÁ1CÂ8C	c                óÂ   € \        \        4       4      ;_uu_ 4        \        P                  ! 4       pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)z°
L{client.createResolver} returns a L{resolve.ResolverChain} including a
L{client.Resolver} using I{/etc/resolv.conf} if no alternate resolver
configuration file is specified.
Ns   /etc/resolv.conf©r	   r   r   r}   rˆ   r]   s   & r.   Útest_defaultResolvConfÚ*CreateResolverTests.test_defaultResolvConf°   s>   € ô œe›g×&Õ&Ü×,Ò,Ó.ˆH÷ 'à×Ñ˜XÐ':Ö;÷ '×&úr€   c                óÆ   € \        \        4       4      ;_uu_ 4        \        P                  ! RR7      pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)z®
The I{resolvconf} parameter to L{client.createResolver} overrides the
resolver configuration file used by the L{client.Resolver} in the
L{resolve.ResolverChain} it returns.
r‚   ©Ú
resolvconfNr�   r]   s   & r.   Útest_overrideResolvConfÚ+CreateResolverTests.test_overrideResolvConfº   s?   € ô œe›g×&Õ&Ü×,Ò,¸ÔDˆH÷ 'à×Ñ˜X {Ö3÷ '×&úr…   c                ó@  € V P                  4       pVP                  R4       \        \        4       4      ;_uu_ 4        \        P
                  ! VP                   R7      pRRR4       XP                   Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P                  ^\        V4      4       V P                  . V^ ,          P                  4       V P                  R.V^ ,          P                  4       R#   + '       g   i     L±; iu upi )z~
If no servers are given, addresses are taken from the file given by the
I{resolvconf} parameter to L{client.createResolver}.
ó   nameserver 127.1.2.3
r”   N©z	127.1.2.3é5   ©ÚpathÚ
setContentr	   r   r   r}   rn   ro   rp   rq   rr   ÚserversÚ
dynServers©r'   r•   r^   rv   rw   s   &    r.   Útest_defaultServersÚ'CreateResolverTests.test_defaultServersÄ   sÄ   € ð
 —Y‘Y“[ˆ
Ø×ÑÐ7Ô8Üœe›g×&Õ&Ü×,Ò,¸
¿¹ÔHˆH÷ 'à"×,Ò,ÓOÑ,�Q´
¸1¼f¿o¹o×0N�qˆqÑ,ˆÐOØ×Ñ˜œC ›HÔ%Ø×Ñ˜˜S �VŸ^™^Ô,Ø×ÑÐ+Ð,¨c°!­f×.?Ñ.?Ö@÷ '×&üâOs   ½"DÁ5"DÂDÄD	c                óF  € V P                  4       pVP                  R4       \        \        4       4      ;_uu_ 4        \        P
                  ! R.VP                   R7      pRRR4       XP                   Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P                  ^\        V4      4       V P                  R.V^ ,          P                  4       V P                  R.V^ ,          P                  4       R#   + '       g   i     L²; iu upi )z€
Servers passed to L{client.createResolver} are used in addition to any
found in the file given by the I{resolvconf} parameter.
r™   )rŸ   r•   N)z	127.3.2.1r›   rš   rœ   r¡   s   &    r.   Útest_overrideServersÚ(CreateResolverTests.test_overrideServersÒ   sÕ   € ð
 —Y‘Y“[ˆ
Ø×ÑÐ7Ô8Üœe›g×&Õ&Ü×,Ò,Ø*Ð+¸
¿¹ôˆH÷ 'ð #×,Ò,ÓOÑ,�Q´
¸1¼f¿o¹o×0N�qˆqÑ,ˆÐOØ×Ñ˜œC ›HÔ%Ø×ÑÐ+Ð,¨c°!­f¯n©nÔ=Ø×ÑÐ+Ð,¨c°!­f×.?Ñ.?Ö@÷ '×&üò Ps   ½$DÁ7"DÂDÄD	c                óX  € \        \        4       4      ;_uu_ 4        \        P                  ! 4       pRRR4       XP                   Uu. uF'  p\        V\        P                  4      '       g   K%  VNK)  	  ppV P                  ^\        V4      4       R#   + '       g   i     Lj; iu upi )za
L{client.createResolver} returns a L{resolve.ResolverChain} including a
L{cache.CacheResolver}.
N)
r	   r   r   r}   rn   ro   r
   ÚCacheResolverrq   rr   )r'   r^   rv   rw   s   &   r.   Ú
test_cacheÚCreateResolverTests.test_cacheâ   sp   € ô
 œe›g×&Õ&Ü×,Ò,Ó.ˆH÷ 'à"×,Ò,ÓSÑ,�Q´
¸1¼e×>QÑ>Q×0R�qˆqÑ,ˆÐSØ×Ñ˜œC ›HÖ%÷ '×&üâSs   œBÁ"B'Á/B'ÂB$	r2   N)r3   r4   r5   r6   rC   rg   rh   rx   r~   rƒ   rˆ   r�   r‘   r–   r¢   r¥   r©   r7   r8   r9   s   @r.   rj   rj   {   sJ   ø‡ € ñð €Dò0ò
1ò/ò2ò
0ò<ò4òAòA÷ &ð &r1   rj   c                   óÌ   a € ] tR t^ít o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t Rt!V t"R# ) ÚResolverTestsz
Tests for L{client.Resolver}.
c                ó.   € \        \        \        4       R# )zE
L{client} provides L{IResolver} through a series of free
functions.
N)r   r   r   r@   s   &r.   Útest_clientProvidesIResolverÚ*ResolverTests.test_clientProvidesIResolverò   s   € ô
 	”Y¤Ö'r1   c                óB   € \        \        \        P                  4       R# )z+
L{client.Resolver} provides L{IResolver}.
N)r   r   r   rp   r@   s   &r.   Ú$test_clientResolverProvidesIResolverÚ2ResolverTests.test_clientResolverProvidesIResolverù   s   € ô 	”IœvŸ™Ö/r1   c                óN   € V P                  \        \        P                  4       R# )zr
L{client.Resolver} raises L{ValueError} if constructed with neither
servers nor a nameserver configuration file.
N)ÚassertRaisesÚ
ValueErrorr   rp   r@   s   &r.   Útest_noServersÚResolverTests.test_noServersÿ   s   € ð
 	×Ñœ*¤f§o¡oÖ6r1   c                óœ   € \         P                  ! V P                  4       \        4       R7      pV P	                  R.VP
                  4       R# )z›
A missing nameserver configuration file results in no server information
being loaded from it (ie, not an exception) and a default server being
provided.
©r‡   rŒ   N©r   r›   )r   rp   Úmktempr   rq   r    r]   s   & r.   Útest_missingConfigurationÚ'ResolverTests.test_missingConfiguration  s6   € ô —?’?¨$¯+©+«-ÄÃÔIˆØ×ÑÐ+Ð,¨h×.AÑ.AÖBr1   c                óö   a€ \        V P                  4       4      pVP                  RR7      o ! V3R lR\        P                  4      pV! R^5.R\        4       R7       V P                  SP                  4       R# )	z‘
As part of its constructor, C{StubResolver} opens C{/etc/resolv.conf};
then, explicitly closes it and does not count on the GC to do so for
it.
zw+)Úmodec                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú9ResolverTests.test_closesResolvConf.<locals>.StubResolveri  c                ó   <€ S# rG   r2   )r'   r   Ú
resolvConfs   &&€r.   Ú	_openFileÚCResolverTests.test_closesResolvConf.<locals>.StubResolver._openFile  s	   ø€ Ø!Ð!r1   r2   N)r3   r4   r5   r6   rÄ   r7   r8   )r:   rÃ   s   @€r.   ÚStubResolverrÁ     s   ù‡ € ÷"ó "r1   rÆ   úexample.comz/etc/resolv.conf)rŸ   r‡   rŒ   N)r   r»   Úopenr   rp   r   r\   Úclosed)r'   ÚhandlerÆ   rÃ   s   &  @r.   Útest_closesResolvConfÚ#ResolverTests.test_closesResolvConf  sb   ø€ ô ˜$Ÿ+™+›-Ó(ˆØ—[‘[ d�[Ó+ˆ
÷	"œ6Ÿ?™?ô 	"ñ 	Ø" BÐ'Ð0BÌEËGõ	
ð 	�‰˜
×)Ñ)Ö*r1   c                ó’   € \         P                  ! R.R7      pVP                  R.4       V P                  RVP                  4       R# )zn
L{client.Resolver.parseConfig} treats a I{domain} line without an
argument as indicating a domain of C{b""}.
©rŸ   s   domain
r1   Nrº   )r   rp   ÚparseConfigrq   Údomainr]   s   & r.   Útest_domainEmptyArgumentÚ&ResolverTests.test_domainEmptyArgument!  s:   € ô
 —?’?Ð,=Ð+>Ô?ˆØ×Ñ˜k˜]Ô+Ø×Ñ˜˜hŸo™oÖ.r1   c                ó’   € \         P                  ! R.R7      pVP                  R.4       V P                  . VP                  4       R# )zr
L{client.Resolver.parseConfig} treats a I{search} line without an
argument as indicating an empty search suffix.
rÎ   s   search
Nrº   )r   rp   rÏ   rq   Úsearchr]   s   & r.   Útest_searchEmptyArgumentÚ&ResolverTests.test_searchEmptyArgument*  s:   € ô
 —?’?Ð,=Ð+>Ô?ˆØ×Ñ˜k˜]Ô+Ø×Ñ˜˜XŸ_™_Ö-r1   c                ó  a€ \        4       oRR.pRR.p\        P                  ! VR7      pW#n        V3R lVn        \        4       pVP                  R4      pVP                  V P                  V4       V P                  \        SP                  4      ^4       V P                  SP                  ^ ,          ^ ,          V^ ,          4       SP                  ^ ,          R,          P                  \        ^ 4      4       V P                  \        SP                  4      ^4       V P                  SP                  ^,          ^ ,          V^,          4       SP                  ^,          R,          P                  \        ^4      4       V P                  \        SP                  4      ^4       V P                  SP                  ^,          ^ ,          V^ ,          4       SP                  ^,          R,          P                  \        ^4      4       V P                  \        SP                  4      ^4       V P                  SP                  ^,          ^ ,          V^,          4       SP                  ^,          R,          P                  V4       V# )	zå
L{client.Resolver.queryUDP} should issue queries to its
L{dns.DNSDatagramProtocol} with server addresses taken from its own
C{servers} and C{dynServers} lists, proceeding through them in order
as L{DNSQueryTimeoutError}s occur.
rÎ   c                 ó   <€ S# rG   r2   )Ú	interfaceÚprotocols   &€r.   Ú<lambda>Ú=ResolverTests.test_datagramQueryServerOrder.<locals>.<lambda>@  s   ø€ ¹r1   N©z::1r›   )z::2r›   )z::3r›   )z::4r›   éÿÿÿÿ)rE   r   rp   r    Ú_connectedProtocolÚobjectÚqueryUDPÚaddCallbackrq   rr   rI   rb   Úerrbackr   Úcallback)r'   rŸ   r    r^   ÚexpectedResultÚqueryResultrÚ   s   &     @r.   Útest_datagramQueryServerOrderÚ+ResolverTests.test_datagramQueryServerOrder3  sî  ø€ ô +Ó,ˆà Ð,ˆØ! ;Ð/ˆ
Ü—?’?¨7Ô3ˆØ(ÔÜ&@ˆÔ#ä›ˆØ×'Ñ'¨Ó-ˆØ×Ñ × 0Ñ 0°.ÔAà×Ñœ˜X×-Ñ-Ó.°Ô2Ø�‰�h×&Ñ& qÕ)¨!Õ,¨g°a­jÔ9Ø×Ñ˜Õ˜BÕ×'Ñ'Ô(<¸QÓ(?Ô@Ø×Ñœ˜X×-Ñ-Ó.°Ô2Ø�‰�h×&Ñ& qÕ)¨!Õ,¨g°a­jÔ9Ø×Ñ˜Õ˜BÕ×'Ñ'Ô(<¸QÓ(?Ô@Ø×Ñœ˜X×-Ñ-Ó.°Ô2Ø�‰�h×&Ñ& qÕ)¨!Õ,¨j¸­mÔ<Ø×Ñ˜Õ˜BÕ×'Ñ'Ô(<¸QÓ(?Ô@Ø×Ñœ˜X×-Ñ-Ó.°Ô2Ø�‰�h×&Ñ& qÕ)¨!Õ,¨j¸­mÔ<Ø×Ñ˜Õ˜BÕ×(Ñ(¨Ô8àÐr1   c                ó´  a a	a
€ \        4       o
\        P                  ! R.R7      pV
3R lVn        S
P                  p\
        P                  ! R\
        P                  \
        P                  4      pVP                  V4      pS P                  \        V4      ^4       VP                  V4      pS P                  \        V4      ^4       \        4       o	\
        P                  ! 4       pVP                  P                  S	4       VP!                  4       R,          P#                  V4       \$        P&                  ! WE.4      pV	V 3R lpVP)                  V4       V# )zÑ
L{client.Resolver.query} only issues one request at a time per query.
Subsequent requests made before responses to prior ones are received
are queued and given the same response as is given to the first one.
rÎ   c                  ó   <€ S # rG   r2   ©rÚ   s   €r.   rÛ   Ú<ResolverTests.test_singleConcurrentRequest.<locals>.<lambda>]  ó   ø€ ©hr1   ó   foo.example.comc                 óh   <€ V w  rSP                  VS.. . 34       SP                  VS.. . 34       R # rG   ©rq   )Ú	responsesÚfirstResponseÚsecondResponseÚanswerr'   s   &  €€r.   Ú
cbFinishedÚ>ResolverTests.test_singleConcurrentRequest.<locals>.cbFinishedr  s=   ø€ Ø,5Ñ)ˆMØ×Ñ˜]¨f¨X°r¸2Ð,>Ô?Ø×Ñ˜^¨v¨h¸¸BÐ-?Ö@r1   ©rÇ   r›   rÞ   )rE   r   rp   rß   rI   r   ÚQueryr$   ÚINrS   rq   rr   rà   ÚMessageÚanswersrP   Úpoprä   r   ÚgatherResultsrâ   )r'   r^   rI   rS   ÚfirstResultÚsecondResultÚresponseÚdrõ   rô   rÚ   s   f        @@r.   Útest_singleConcurrentRequestÚ*ResolverTests.test_singleConcurrentRequestU  s   ú€ ô +Ó,ˆÜ—?’?Ð,?Ð+@ÔAˆÜ&6ˆÔ#Ø×"Ñ"ˆä—	’	Ð,¬c¯e©e´S·V±VÓ<ˆà—n‘n UÓ+ˆØ×Ñœ˜W› qÔ)ð  —~‘~ eÓ,ˆØ×Ñœ˜W› qÔ)ô “ˆÜ—;’;“=ˆØ×Ñ×Ñ Ô'Ø�‰‹�bÕ×"Ñ" 8Ô,ä×Ò Ð ;Ó<ˆö	Að
 	
�‰�jÔ!Øˆr1   c                ó`  a€ \        4       o\        P                  ! R.R7      pV3R lVn        SP                  p\
        P                  ! R\
        P                  4      pVP                  V4       V P                  \        V4      ^4       \
        P                  ! R\
        P                  4      pVP                  V4       V P                  \        V4      ^4       \
        P                  ! R\
        P                  4      pVP                  V4       V P                  \        V4      ^4       R# )zP
L{client.Resolver.query} issues a request for each different concurrent
query.
rÎ   c                  ó   <€ S # rG   r2   rë   s   €r.   rÛ   Ú?ResolverTests.test_multipleConcurrentRequests.<locals>.<lambda>�  rí   r1   rî   ó   bar.example.comNr÷   )rE   r   rp   rß   rI   r   rø   r$   rS   rq   rr   ÚA6)r'   r^   rI   Ú
firstQueryÚsecondQueryÚ
thirdQueryrÚ   s   &     @r.   Útest_multipleConcurrentRequestsÚ-ResolverTests.test_multipleConcurrentRequestsz  s×   ø€ ô
 +Ó,ˆÜ—?’?Ð,?Ð+@ÔAˆÜ&6ˆÔ#Ø×"Ñ"ˆô —Y’YÐ1´3·5±5Ó9ˆ
Ø�‰�zÔ"Ø×Ñœ˜W› qÔ)ô —i’iÐ 2´C·E±EÓ:ˆØ�‰�{Ô#Ø×Ñœ˜W› qÔ)ô —Y’YÐ1´3·6±6Ó:ˆ
Ø�‰�zÔ"Ø×Ñœ˜W› qÖ)r1   c                óæ  a€ \        4       o\        P                  ! R.R7      pV3R lVn        SP                  p\
        P                  ! R\
        P                  4      pVP                  V4       V P                  \        V4      ^4       VP                  4       R,          P                  \
        P                  ! 4       4       VP                  V4       V P                  \        V4      ^4       R# )z˜
After a response is received to a query issued with
L{client.Resolver.query}, another query with the same parameters
results in a new network request.
rÎ   c                  ó   <€ S # rG   r2   rë   s   €r.   rÛ   Ú?ResolverTests.test_multipleSequentialRequests.<locals>.<lambda>�  rí   r1   rî   Nr÷   rÞ   )rE   r   rp   rß   rI   r   rø   r$   rS   rq   rr   rü   rä   rú   )r'   r^   rI   rS   rÚ   s   &   @r.   Útest_multipleSequentialRequestsÚ-ResolverTests.test_multipleSequentialRequests•  s¬   ø€ ô +Ó,ˆÜ—?’?Ð,?Ð+@ÔAˆÜ&6ˆÔ#Ø×"Ñ"ˆä—	’	Ð,¬c¯e©eÓ4ˆð 	�‰�uÔØ×Ñœ˜W› qÔ)ð 	�‰‹�bÕ×"Ñ"¤3§;¢;£=Ô1ð 	�‰�uÔØ×Ñœ˜W› qÖ)r1   c                ó  a€ \        4       o\        P                  ! R.R7      pV3R lVn        SP                  p\
        P                  ! R\
        P                  4      pVP                  V4      pVP                  V4      p ! R R\        4      pVP                  4       R,          P                  \        P                  ! V! 4       4      4       \        P                  ! V P!                  WF4      V P!                  WV4      .4      # )z›
If the result of a request is an error response, the Deferreds for all
concurrently issued requests associated with that result fire with the
L{Failure}.
rÎ   c                  ó   <€ S # rG   r2   rë   s   €r.   rÛ   Ú>ResolverTests.test_multipleConcurrentFailure.<locals>.<lambda>µ  rí   r1   rî   c                   ó   € ] tR tRtRtR# )ÚGResolverTests.test_multipleConcurrentFailure.<locals>.ExpectedExceptioni¼  r2   N©r3   r4   r5   r6   r7   r2   r1   r.   ÚExpectedExceptionr  ¼  ó   † Ûr1   r  r÷   rÞ   )rE   r   rp   rß   rI   r   rø   r$   rS   Ú	Exceptionrü   rã   r   ÚFailurer   rý   ÚassertFailure)r'   r^   rI   rS   rþ   rÿ   r  rÚ   s   &      @r.   Útest_multipleConcurrentFailureÚ,ResolverTests.test_multipleConcurrentFailure­  sË   ø€ ô +Ó,ˆÜ—?’?Ð,?Ð+@ÔAˆÜ&6ˆÔ#Ø×"Ñ"ˆä—	’	Ð,¬c¯e©eÓ4ˆØ—n‘n UÓ+ˆØ—~‘~ eÓ,ˆô	¤	ô 	ð 	�‰‹�bÕ×!Ñ!¤'§/¢/Ñ2CÓ2EÓ"FÔGä×"Ò"à×"Ñ" ;ÓBØ×"Ñ" <ÓCðó
ð 	
r1   c                óZ  € \         P                  ! R.R7      pVP                  4       pVP                  4       pV P                  VP                  4       V P                  VP                  4       V P                  VP                  P                  4       P                  VP                  P                  4       P                  4       \        P                  ! \        P                  ! VP                  P                  4      \        P                  ! VP                  P                  4      .4      # )z›
L{client.Resolver._connectedProtocol} returns a new
L{DNSDatagramProtocol} connected to a new address with a
cryptographically secure random port number.
rÎ   r÷   )r   rp   rß   ÚassertIsNotNonerJ   ÚassertNotEqualÚgetHostÚportr   rý   ÚmaybeDeferredrA   )r'   r^   Ú
firstProtoÚsecondProtos   &   r.   Útest_connectedProtocolÚ$ResolverTests.test_connectedProtocolÈ  så   € ô —?’?Ð,?Ð+@ÔAˆØ×0Ñ0Ó2ˆ
Ø×1Ñ1Ó3ˆà×Ñ˜Z×1Ñ1Ô2Ø×Ñ˜[×2Ñ2Ô3Ø×ÑØ× Ñ ×(Ñ(Ó*×/Ñ/°×1FÑ1F×1NÑ1NÓ1P×1UÑ1Uô	
ô ×"Ò"ä×#Ò# J×$8Ñ$8×$FÑ$FÓGÜ×#Ò# K×$9Ñ$9×$GÑ$GÓHðó
ð 	
r1   c                óÔ   € \         P                  ! 4       p\        P                  ! V P	                  4       VR7      pVP                  4       pV P                  VP                  V4       R# )z¥
If a reactor instance is supplied to L{client.Resolver}
L{client.Resolver._connectedProtocol} should pass that reactor
to L{twisted.names.dns.DNSDatagramProtocol}.
r¹   N)r   ÚMemoryReactorr   rp   r»   rß   rb   r‹   )r'   rŒ   r^   Úprotos   &   r.   Ú)test_resolverUsesOnlyParameterizedReactorÚ7ResolverTests.test_resolverUsesOnlyParameterizedReactorß  sH   € ô ×)Ò)Ó+ˆÜ—?’?¨$¯+©+«-ÀÔIˆØ×+Ñ+Ó-ˆØ�‰�e—n‘n gÖ.r1   c                ó>  a€ \         P                  ! R.R7      p. o ! V3R lR4      pW!n        VP                  \        P
                  ! R4      4       VP                  \        P
                  ! R4      4       V P                  \        \        S4      4      ^4       R# )zŸ
L{client.Resolver._connectedProtocol} is called once each time a UDP
request needs to be issued and the resulting protocol instance is used
for that request.
rÎ   c                   ó8   <a € ] tR tRt o R tRV3R lltRtV tR# )Ú:ResolverTests.test_differentProtocol.<locals>.FakeProtocolió  c                ó$   € \        4       V n        R # rG   ©r<   rJ   r@   s   &r.   rK   ÚCResolverTests.test_differentProtocol.<locals>.FakeProtocol.__init__ô  ó   € Ü!)£�–r1   Nc                óx   <€ SP                  V 4       \        P                  ! \        P                  ! 4       4      # rG   )rP   r   r&   r   rú   )r'   r   rS   r)   rQ   Ú	protocolss   &&&&&€r.   rS   Ú@ResolverTests.test_differentProtocol.<locals>.FakeProtocol.query÷  s&   ø€ Ø× Ñ  Ô&Ü—}’}¤S§[¢[£]Ó3Ð3r1   ©rJ   rV   ©r3   r4   r5   r6   rK   rS   r7   r8   )r:   r7  s   @€r.   ÚFakeProtocolr1  ó  s   ù‡ € ò,÷4õ 4r1   r;  rî   r  Nr÷   )	r   rp   rß   rS   r   rø   rq   rr   Úset)r'   r^   r;  r7  s   &  @r.   Útest_differentProtocolÚ$ResolverTests.test_differentProtocolê  ss   ø€ ô —?’?Ð,?Ð+@ÔAˆØˆ	÷	4ô 	4ð '3Ô#Ø�‰”s—y’yÐ!3Ó4Ô5Ø�‰”s—y’yÐ!3Ó4Ô5Ø×ÑœœS ›^Ó,¨aÖ0r1   c                ó@  € \         P                  ! 4       p\        P                  ! R.VR7      pVP	                  \
        P                  ! R4      4       VP                  P                  4       w  w  r4VP                  4       P                  pV P                  RV4       R# )z,
If the resolver is ipv6, open a ipv6 port.
©rŸ   rŒ   rî   z::NrÝ   )r   r+  r   rp   rS   r   rø   ÚudpPortsÚitemsr#  Úhostrq   )r'   Úfaker^   r,  rJ   rÙ   s   &     r.   Útest_ipv6ResolverÚResolverTests.test_ipv6Resolver   sv   € ô
 ×&Ò&Ó(ˆÜ—?’?¨K¨=À$ÔGˆØ�‰”s—y’yÐ!3Ó4Ô5Ø#Ÿ}™}×2Ñ2Ó4ÑÑ	ˆ%Ø×%Ñ%Ó'×,Ñ,ˆ	Ø×Ñ˜˜yÖ)r1   c                óÖ   a€ . o ! V3R lR4      p\         P                  ! R.R7      pV! 4       Vn        VP                  4        V P	                  \        \        S4      4      ^4       R# )z‰
If a port number is initially selected which cannot be bound, the
L{CannotListenError} is handled and another port number is attempted.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú6ResolverTests.test_disallowedPort.<locals>.FakeReactori  c                ód   <€ SP                  V4       \        S4      ^8X  d   \        RVR4      hR# rl   )rP   rr   r   ©r'   r$  ÚargsÚkwargsÚportss   &&*,€r.   Ú	listenUDPÚ@ResolverTests.test_disallowedPort.<locals>.FakeReactor.listenUDP  s.   ø€ Ø—‘˜TÔ"Ü�u“: ”?Ü+¨D°$¸Ó=Ð=ñ #r1   r2   N©r3   r4   r5   r6   rO  r7   r8   ©r:   rN  s   @€r.   ÚFakeReactorrI    s   ù‡ € ÷>ó >r1   rS  rÎ   Nr÷   )r   rp   r‹   rß   rq   rr   r<  ©r'   rS  r^   rN  s   &  @r.   Útest_disallowedPortÚ!ResolverTests.test_disallowedPort  sV   ø€ ð
 ˆ÷	>ô 	>ô —?’?Ð,?Ð+@ÔAˆÙ'›MˆÔà×#Ñ#Ô%Ø×ÑœœS ›Z›¨!Ö,r1   c                óä   a€ . o ! V3R lR4      p\         P                  ! R.R7      pV! 4       Vn        V P                  \        VP
                  4       V P                  \        S4      R4       R# )zw
If port numbers that cannot be bound are repeatedly selected,
L{resolver._connectedProtocol} will give up eventually.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú@ResolverTests.test_disallowedPortRepeatedly.<locals>.FakeReactori&  c                ó@   <€ SP                  V4       \        R VR 4      hrG   )rP   r   rK  s   &&*,€r.   rO  ÚJResolverTests.test_disallowedPortRepeatedly.<locals>.FakeReactor.listenUDP'  s   ø€ Ø—‘˜TÔ"Ü'¨¨d°DÓ9Ð9r1   r2   NrQ  rR  s   @€r.   rS  rY  &  s   ù‡ € ÷:ó :r1   rS  rÎ   iè  Nr÷   )r   rp   r‹   r´   r   rß   rq   rr   rT  s   &  @r.   Útest_disallowedPortRepeatedlyÚ+ResolverTests.test_disallowedPortRepeatedly  s]   ø€ ð
 ˆ÷	:ô 	:ô
 —?’?Ð,?Ð+@ÔAˆÙ'›MˆÔà×ÑÔ+¨X×-HÑ-HÔIà×Ñœ˜U› TÖ*r1   c                óL  a€ . o ! V3R lR4      p\         P                  ! R.R7      pV! 4       Vn        V P                  \        VP
                  4      pV P                  VP                  P                  \        P                  4       V P                  \        S4      ^4       R# )zN
If the process is out of files, L{Resolver._connectedProtocol}
will give up.
c                   ó.   <a € ] tR tRt o V3R ltRtV tR# )Ú5ResolverTests.test_runOutOfFiles.<locals>.FakeReactori9  c                ór   <€ SP                  V4       \        \        P                  R 4      p\	        RW4      h)zOut of files :(N)rP   ÚOSErrorÚerrnoÚEMFILEr   )r'   r$  rL  rM  ÚerrrN  s   &&*, €r.   rO  Ú?ResolverTests.test_runOutOfFiles.<locals>.FakeReactor.listenUDP:  s-   ø€ Ø—‘˜TÔ"ÜœeŸl™lÐ,=Ó>�Ü'¨¨dÓ8Ð8r1   r2   NrQ  rR  s   @€r.   rS  r`  9  s   ù‡ € ÷9ó 9r1   rS  rÎ   Nr÷   )r   rp   r‹   r´   r   rß   rq   ÚsocketErrorrc  rd  rr   )r'   rS  r^   ÚexcrN  s   &   @r.   Útest_runOutOfFilesÚ ResolverTests.test_runOutOfFiles2  s   ø€ ð
 ˆ÷	9ô 	9ô —?’?Ð,?Ð+@ÔAˆÙ'›MˆÔà×ÑÔ 1°8×3NÑ3NÓOˆð 	×Ñ˜Ÿ™×.Ñ.´·±Ô=Ø×Ñœ˜U› QÖ'r1   c                ó°  aa€ \         P                  ! R.R7      p. o\        P                  ! \        P
                  ! \        R4      4      4      \        P                  ! \        P                  ! 4       4      .o ! VV3R lR4      pW!n
        VP                  \        P                  ! R4      4       V P                  \        \        S4      4      ^4       R# )zd
When a query issued by L{client.Resolver.query} times out, the retry
uses a new protocol instance.
rÎ   Nc                   ó:   <a € ] tR tRt o R tRVV3R lltRtV tR# )ÚFResolverTests.test_differentProtocolAfterTimeout.<locals>.FakeProtocoliT  c                ó$   € \        4       V n        R # rG   r3  r@   s   &r.   rK   ÚOResolverTests.test_differentProtocolAfterTimeout.<locals>.FakeProtocol.__init__U  r5  r1   Nc                óH   <€ SP                  V 4       SP                  ^ 4      # ©é    ©rP   rü   ©r'   r   rS   r)   rQ   r7  r+   s   &&&&&€€r.   rS   ÚLResolverTests.test_differentProtocolAfterTimeout.<locals>.FakeProtocol.queryX  ó   ø€ Ø× Ñ  Ô&Ø—{‘{ 1“~Ð%r1   r9  rV   r:  ©r:   r7  r+   s   @€€r.   r;  rm  T  ó   ù‡ € ò,÷&ö &r1   r;  rî   r÷   )r   rp   r   Úfailr   r  r   r&   r   rú   rß   rS   rø   rq   rr   r<  )r'   r^   r;  r7  r+   s   &  @@r.   Ú"test_differentProtocolAfterTimeoutÚ0ResolverTests.test_differentProtocolAfterTimeoutH  s‘   ù€ ô
 —?’?Ð,?Ð+@ÔAˆØˆ	ä�JŠJ”w—’Ô';¸DÓ'AÓBÓCÜ�MŠMœ#Ÿ+š+›-Ó(ð
ˆ÷
	&õ 	&ð '3Ô#Ø�‰”s—y’yÐ!3Ó4Ô5Ø×ÑœœS ›^Ó,¨aÖ0r1   c                óÒ  aa€ \         P                  ! R.R7      p. o\        P                  ! 4       o ! VV3R lR4      pW!n        VP                  \        P                  ! R4      4       V P                  S^ ,          P                  P                  4       SP                  \        P                  ! 4       4       V P                  S^ ,          P                  P                  4       R# )z�
After the L{Deferred} returned by L{DNSDatagramProtocol.query} is
called back, the L{DNSDatagramProtocol} is disconnected from its
transport.
rÎ   c                   ó:   <a € ] tR tRt o R tRVV3R lltRtV tR# )Ú9ResolverTests.test_protocolShutDown.<locals>.FakeProtocolij  c                ó$   € \        4       V n        R # rG   r3  r@   s   &r.   rK   ÚBResolverTests.test_protocolShutDown.<locals>.FakeProtocol.__init__k  r5  r1   Nc                ó*   <€ SP                  V 4       S# rG   ©rP   ©r'   r   rS   r)   rQ   r7  rR   s   &&&&&€€r.   rS   Ú?ResolverTests.test_protocolShutDown.<locals>.FakeProtocol.queryn  ó   ø€ Ø× Ñ  Ô&Ø�r1   r9  rV   r:  ©r:   r7  rR   s   @€€r.   r;  r~  j  ó   ù‡ € ò,÷ö r1   r;  rî   Nr÷   )r   rp   r   rO   rß   rS   r   rø   ÚassertFalserJ   r?   rä   rú   r\   )r'   r^   r;  r7  rR   s   &  @@r.   Útest_protocolShutDownÚ#ResolverTests.test_protocolShutDown`  sœ   ù€ ô —?’?Ð,?Ð+@ÔAˆØˆ	Ü—’Ó!ˆ÷	õ 	ð '3Ô#Ø�‰”s—y’yÐ!3Ó4Ô5à×Ñ˜ 1�×/Ñ/×<Ñ<Ô=Ø�‰œŸš›Ô&Ø�‰˜	 !�×.Ñ.×;Ñ;Ö<r1   c                ó<  aa€ \         P                  ! R.R7      p. o\        P                  ! 4       p\        P                  ! \
        P                  ! \        R4      4      4      V.o ! VV3R lR4      pW1n        VP                  \        P                  ! R4      4       V P                  S^,          P                  P                  4       VP                  \        P                   ! 4       4       V P#                  S^,          P                  P                  4       R# )z¦
The L{DNSDatagramProtocol} created when an interim timeout occurs is
also disconnected from its transport after the Deferred returned by its
query method completes.
rÎ   Nc                   ó:   <a € ] tR tRt o R tRVV3R lltRtV tR# )ÚEResolverTests.test_protocolShutDownAfterTimeout.<locals>.FakeProtocoli„  c                ó$   € \        4       V n        R # rG   r3  r@   s   &r.   rK   ÚNResolverTests.test_protocolShutDownAfterTimeout.<locals>.FakeProtocol.__init__…  r5  r1   Nc                óH   <€ SP                  V 4       SP                  ^ 4      # rq  rs  rt  s   &&&&&€€r.   rS   ÚKResolverTests.test_protocolShutDownAfterTimeout.<locals>.FakeProtocol.queryˆ  rv  r1   r9  rV   r:  rw  s   @€€r.   r;  r�  „  rx  r1   r;  rî   r÷   )r   rp   r   rO   ry  r   r  r   rß   rS   r   rø   rˆ  rJ   r?   rä   rú   r\   )r'   r^   rR   r;  r7  r+   s   &   @@r.   Ú!test_protocolShutDownAfterTimeoutÚ/ResolverTests.test_protocolShutDownAfterTimeouty  s¾   ù€ ô —?’?Ð,?Ð+@ÔAˆØˆ	Ü—’Ó!ˆÜ—:’:œgŸošoÔ.BÀ4Ó.HÓIÓJÈFÐSˆ÷	&õ 	&ð '3Ô#Ø�‰”s—y’yÐ!3Ó4Ô5à×Ñ˜ 1�×/Ñ/×<Ñ<Ô=Ø�‰œŸš›Ô&Ø�‰˜	 !�×.Ñ.×;Ñ;Ö<r1   c                ó  aa€  ! R R\         4      p\        P                  ! R.R7      p. o\        P                  ! 4       o ! VV3R lR4      pW2n        VP                  \        P                  ! R4      4      pV P                  S^ ,          P                  P                  4       SP                  \        P                  ! V! 4       4      4       V P                  S^ ,          P                  P                  4       V P!                  WA4      # )z˜
If the L{Deferred} returned by L{DNSDatagramProtocol.query} fires with
a failure, the L{DNSDatagramProtocol} is still disconnected from its
transport.
c                   ó   € ] tR tRtRtR# )ÚJResolverTests.test_protocolShutDownAfterFailure.<locals>.ExpectedExceptioniš  r2   Nr  r2   r1   r.   r  r–  š  r  r1   r  rÎ   c                   ó:   <a € ] tR tRt o R tRVV3R lltRtV tR# )ÚEResolverTests.test_protocolShutDownAfterFailure.<locals>.FakeProtocoli¡  c                ó$   € \        4       V n        R # rG   r3  r@   s   &r.   rK   ÚNResolverTests.test_protocolShutDownAfterFailure.<locals>.FakeProtocol.__init__¢  r5  r1   Nc                ó*   <€ SP                  V 4       S# rG   r‚  rƒ  s   &&&&&€€r.   rS   ÚKResolverTests.test_protocolShutDownAfterFailure.<locals>.FakeProtocol.query¥  r…  r1   r9  rV   r:  r†  s   @€€r.   r;  r˜  ¡  r‡  r1   r;  rî   r÷   )r  r   rp   r   rO   rß   rS   r   rø   rˆ  rJ   r?   rã   r   r  r\   r  )r'   r  r^   r;  ræ   r7  rR   s   &    @@r.   Ú!test_protocolShutDownAfterFailureÚ/ResolverTests.test_protocolShutDownAfterFailure“  sÂ   ù€ ô	¤	ô 	ô —?’?Ð,?Ð+@ÔAˆØˆ	Ü—’Ó!ˆ÷	õ 	ð '3Ô#Ø—n‘n¤S§Y¢YÐ/AÓ%BÓCˆà×Ñ˜ 1�×/Ñ/×<Ñ<Ô=Ø�‰”w—’Ñ'8Ó':Ó;Ô<Ø�‰˜	 !�×.Ñ.×;Ñ;Ô<à×!Ñ! +ÓAÐAr1   c                ó  € \         P                  ! R.R7      pVP                  P                  R4      pVP	                  R4       V P                  W!P                  4       VP                  R4       V P                  W!P                  4       R# )zt
When a TCP DNS protocol associated with a Resolver disconnects, it is
removed from the Resolver's connection list.
rÎ   Nr÷   )	r   rp   ÚfactoryÚbuildProtocolÚmakeConnectionÚassertInÚconnectionsÚconnectionLostÚassertNotIn)r'   r^   rÚ   s   &  r.   Ú(test_tcpDisconnectRemovesFromConnectionsÚ6ResolverTests.test_tcpDisconnectRemovesFromConnections²  sp   € ô
 —?’?Ð,?Ð+@ÔAˆØ×#Ñ#×1Ñ1°$Ó7ˆØ×Ñ Ô%Ø�‰�h× 4Ñ 4Ô5ð 	×Ñ Ô%Ø×Ñ˜×#7Ñ#7Ö8r1   c                ó’  € \         P                  ! 4       p\        P                  ! R.VR7      pVP	                  \
        P                  ! R4      4      pVP                  ^ ,          w  rErgp ! R R\        4      p	VP                  VP                  ^ ,          \        P                  ! V	! 4       4      4       V P                  W94       R# )z¶
The deferred returned by L{client.Resolver.queryTCP} will
errback when the TCP connection attempt fails. The reason for
the connection failure is passed as the argument to errback.
r@  rÇ   c                   ó   € ] tR tRtRtR# )ÚVResolverTests.test_singleTCPQueryErrbackOnConnectionFailure.<locals>.SentinelExceptioniÌ  r2   Nr  r2   r1   r.   ÚSentinelExceptionr«  Ì  r  r1   r¬  N©z192.0.2.100r›   )r   r+  r   rp   ÚqueryTCPr   rø   Ú
tcpClientsr  ÚclientConnectionFailedÚ
connectorsr   r  ÚfailureResultOf)
r'   rŒ   r^   r  rC  r$  r   r)   ÚbindAddressr¬  s
   &         r.   Ú-test_singleTCPQueryErrbackOnConnectionFailureÚ;ResolverTests.test_singleTCPQueryErrbackOnConnectionFailureÀ  sŸ   € ô  ×-Ò-Ó/ˆÜ—?’?Ð,?Ð+@È'ÔRˆà×ÑœcŸiši¨Ó6Ó7ˆØ4;×4FÑ4FÀqÕ4IÑ1ˆ�G kô	¤	ô 	ð 	×&Ñ&Ø×Ñ˜qÕ!¤7§?¢?Ñ3DÓ3FÓ#Gô	
ð 	×Ñ˜QÖ2r1   c                ó   € \         P                  ! 4       p\        P                  ! R.VR7      pVP	                  \
        P                  ! R4      4      pVP	                  \
        P                  ! R4      4      pVP                  ^ ,          w  rVrxp	 ! R R\        4      p
VP                  VP                  ^ ,          \        P                  ! V
! 4       4      4       V P                  W:4      pV P                  WJ4      pV P                  W¼4       R# )zy
All pending L{resolver.queryTCP} C{deferred}s will C{errback}
with the same C{Failure} if the connection attempt fails.
r@  rÇ   zexample.netc                   ó   € ] tR tRtRtR# )ÚXResolverTests.test_multipleTCPQueryErrbackOnConnectionFailure.<locals>.SentinelExceptioniá  r2   Nr  r2   r1   r.   r¬  r¸  á  r  r1   r¬  Nr­  )r   r+  r   rp   r®  r   rø   r¯  r  r°  r±  r   r  r²  rb   )r'   rŒ   r^   Úd1Úd2rC  r$  r   r)   r³  r¬  Úf1Úf2s   &            r.   Ú/test_multipleTCPQueryErrbackOnConnectionFailureÚ=ResolverTests.test_multipleTCPQueryErrbackOnConnectionFailureÕ  sÖ   € ô
  ×-Ò-Ó/ˆÜ—?’?Ð,?Ð+@È'ÔRˆà×ÑœsŸyšy¨Ó7Ó8ˆØ×ÑœsŸyšy¨Ó7Ó8ˆØ4;×4FÑ4FÀqÕ4IÑ1ˆ�G kô	¤	ô 	ð 	×&Ñ&Ø×Ñ˜qÕ!¤7§?¢?Ñ3DÓ3FÓ#Gô	
ð ×!Ñ! "Ó8ˆØ×!Ñ! "Ó8ˆØ�‰�bÖr1   c                ó®  aa€ \         P                  ! 4       p\        P                  ! R.VR7      o\        P
                  ! R4      oSP                  S4      pVV3R lpVP                  V4       V P                  \        VP                  4      ^4       V P                  \        VP                  4      ^4       VP                  ^ ,          w  rErgp\        P                  ! \        4       4      p	VP                  VP                  ^ ,          V	4       V P                  \        VP                  4      ^4       V P                  \        VP                  4      ^4       V P!                  V4       \        P                  ! \        4       4      p
VP                  VP                  ^,          V
4       V P#                  V\        4      pV P%                  Wº4       R# )zc
An errback on the deferred returned by
L{client.Resolver.queryTCP} may trigger another TCP query.
r@  rÇ   c                 óP   <€ V P                  \        4       SP                  S4      # rG   )Útrapr   r®  )ÚeÚqr^   s   &€€r.   ÚreissueÚOResolverTests.test_reentrantTCPQueryErrbackOnConnectionFailure.<locals>.reissueú  s!   ø€ Ø�F‰FÔ)Ô*Ø×$Ñ$ QÓ'Ð'r1   N)r   iE'  )r   r+  r   rp   r   rø   r®  Ú
addErrbackrq   rr   r¯  r±  r   r  r   r°  ÚassertNoResultr²  rb   )r'   rŒ   r  rÄ  rC  r$  r   r)   r³  r»  r¼  ÚfrÃ  r^   s   &           @@r.   Ú0test_reentrantTCPQueryErrbackOnConnectionFailureÚ>ResolverTests.test_reentrantTCPQueryErrbackOnConnectionFailureì  sl  ù€ ô
  ×-Ò-Ó/ˆÜ—?’?Ð,@Ð+AÈ7ÔSˆä�IŠI�mÓ$ˆð ×Ñ˜aÓ ˆö	(ð 	
�‰�WÔà×Ñœ˜W×/Ñ/Ó0°!Ô4Ø×Ñœ˜W×/Ñ/Ó0°!Ô4à4;×4FÑ4FÀqÕ4IÑ1ˆ�G kô �_Š_Ô3Ó5Ó6ˆØ×&Ñ& w×'9Ñ'9¸!Õ'<¸bÔAð 	×Ñœ˜W×/Ñ/Ó0°!Ô4Ø×Ñœ˜W×/Ñ/Ó0°!Ô4à×Ñ˜AÔô �_Š_Ô3Ó5Ó6ˆØ×&Ñ& w×'9Ñ'9¸!Õ'<¸bÔAð × Ñ  Ô$:Ó;ˆØ�‰�aÖr1   c                óN  € \         P                  ! 4       p\        P                  ! R.VR7      pVP	                  \
        P                  ! R4      4      pVP                  ^ ,          w  rErgpVP                  p	V P                  \        V	4      ^4        ! R R\        4      p
VP                  VP                  ^ ,          \        P                  ! V
! 4       4      4       V P!                  W:4       V P#                  VP                  V	4       V P                  \        V	4      ^ 4       R# )z‹
When the TCP connection attempt fails, the
L{client.Resolver.pending} list is emptied in place. It is not
replaced with a new empty list.
r@  rÇ   c                   ó   € ] tR tRtRtR# )ÚJResolverTests.test_pendingEmptiedInPlaceOnError.<locals>.SentinelExceptioni'  r2   Nr  r2   r1   r.   r¬  rÍ  '  r  r1   r¬  Nr­  )r   r+  r   rp   r®  r   rø   r¯  Úpendingrq   rr   r  r°  r±  r   r  r²  rb   )r'   rŒ   r^   r  rC  r$  r   r)   r³  Ú
prePendingr¬  s   &          r.   Ú!test_pendingEmptiedInPlaceOnErrorÚ/ResolverTests.test_pendingEmptiedInPlaceOnError  sæ   € ô  ×-Ò-Ó/ˆÜ—?’?Ð,?Ð+@È'ÔRˆà×ÑœcŸiši¨Ó6Ó7ˆà4;×4FÑ4FÀqÕ4IÑ1ˆ�G kà×%Ñ%ˆ
Ø×Ñœ˜Z›¨!Ô,ô	¤	ô 	ð 	×&Ñ&Ø×Ñ˜qÕ!¤7§?¢?Ñ3DÓ3FÓ#Gô	
ð 	×Ñ˜QÔ2Ø�‰�h×&Ñ&¨
Ô3Ø×Ñœ˜Z›¨!Ö,r1   r2   N)#r3   r4   r5   r6   rC   r®   r±   r¶   r¼   rË   rÑ   rÕ   rç   r  r  r  r  r(  r-  r=  rE  rU  r\  ri  rz  r‰  r’  r�  r§  r´  r½  rÉ  rÐ  r7   r8   r9   s   @r.   r¬   r¬   í   s    ø‡ € ñò(ò0ò7òCò+ò$/ò.ò òD#òJ*ò6*ò0
ò6
ò.	/ò1ò,
*ò-ò&+ò&(ò,1ò0=ò2=ò4Bò>9ò3ò*ò.)÷V-ð -r1   r¬   c                   óÎ   a € ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t Rt!V t"R # )!ÚClientTestsi3  c                óH   € \        4       \        n        RV n        RV n        R# )z*
Replace the resolver with a FakeResolver
ó   example.comr   N)r   r   ÚtheResolverÚhostnameÚhostnameForGetHostByNamer@   s   &r.   ÚsetUpÚClientTests.setUp4  s   € ô *›^ŒÔØ&ˆŒØ(<ˆÖ%r1   c                ó   € R\         n        R# )zX
By setting the resolver to None, it will be recreated next time a name
lookup is done.
N)r   rÖ  r@   s   &r.   ÚtearDownÚClientTests.tearDown<  s   € ð
 "ŒÖr1   c                óº   € Vw  r4pV^ ,          pV P                  VP                  P                  V P                  4       V P                  VP                  V4       R# )zD
Verify that the result is the same query type as what is expected.
N)rq   r   r×  r    )r'   r+   r(   rû   r,   r-   rR   s   &&&    r.   ÚcheckResultÚClientTests.checkResultC  sI   € ð *1Ñ&ˆ˜JØ˜•ˆØ×Ñ˜Ÿ™×)Ñ)¨4¯=©=Ô9Ø×Ñ˜Ÿ™ eÖ,r1   c                ó*   € V P                  VR4       R# )zB
Test that the getHostByName query returns the 127.0.0.1 address.
r   Nrð   ©r'   rR   s   &&r.   ÚcheckGetHostByNameÚClientTests.checkGetHostByNameL  s   € ð 	×Ñ˜ Ö-r1   c                ó|   € \         P                  ! V P                  4      pVP                  V P                  4       V# )z=
do a getHostByName of a value that should return 127.0.0.1.
)r   ÚgetHostByNamerØ  râ   rã  ©r'   r  s   & r.   Útest_getHostByNameÚClientTests.test_getHostByNameR  s1   € ô × Ò  ×!>Ñ!>Ó?ˆØ	�‰�d×-Ñ-Ô.Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# )zÀ
Do a lookup and test that the resolver will issue the correct type of
query type. We do this by checking that FakeResolver returns a result
record with the same query type as what we issued.
)r   ÚlookupAddressr×  râ   rß  r   r$   rç  s   & r.   Útest_lookupAddressÚClientTests.test_lookupAddressZ  s5   € ô × Ò  §¡Ó/ˆØ	�‰�d×&Ñ&¬¯©Ô.Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# ©z
See L{test_lookupAddress}
)r   ÚlookupIPV6Addressr×  râ   rß  r   ÚAAAArç  s   & r.   Útest_lookupIPV6AddressÚ"ClientTests.test_lookupIPV6Addressd  s5   € ô ×$Ò$ T§]¡]Ó3ˆØ	�‰�d×&Ñ&¬¯©Ô1Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupAddress6r×  râ   rß  r   r  rç  s   & r.   Útest_lookupAddress6ÚClientTests.test_lookupAddress6l  s5   € ô ×!Ò! $§-¡-Ó0ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupNameserversr×  râ   rß  r   ÚNSrç  s   & r.   Útest_lookupNameserversÚ"ClientTests.test_lookupNameserverst  s5   € ô ×$Ò$ T§]¡]Ó3ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupCanonicalNamer×  râ   rß  r   ÚCNAMErç  s   & r.   Útest_lookupCanonicalNameÚ$ClientTests.test_lookupCanonicalName|  s5   € ô ×&Ò& t§}¡}Ó5ˆØ	�‰�d×&Ñ&¬¯	©	Ô2Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupAuthorityr×  râ   rß  r   ÚSOArç  s   & r.   Útest_lookupAuthorityÚ ClientTests.test_lookupAuthority„  s5   € ô ×"Ò" 4§=¡=Ó1ˆØ	�‰�d×&Ñ&¬¯©Ô0Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupMailBoxr×  râ   rß  r   ÚMBrç  s   & r.   Útest_lookupMailBoxÚClientTests.test_lookupMailBoxŒ  s5   € ô × Ò  §¡Ó/ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupMailGroupr×  râ   rß  r   ÚMGrç  s   & r.   Útest_lookupMailGroupÚ ClientTests.test_lookupMailGroup”  s5   € ô ×"Ò" 4§=¡=Ó1ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupMailRenamer×  râ   rß  r   ÚMRrç  s   & r.   Útest_lookupMailRenameÚ!ClientTests.test_lookupMailRenameœ  s5   € ô ×#Ò# D§M¡MÓ2ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   Ú
lookupNullr×  râ   rß  r   ÚNULLrç  s   & r.   Útest_lookupNullÚClientTests.test_lookupNull¤  ó5   € ô ×Ò˜dŸm™mÓ,ˆØ	�‰�d×&Ñ&¬¯©Ô1Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupWellKnownServicesr×  râ   rß  r   ÚWKSrç  s   & r.   Útest_lookupWellKnownServicesÚ(ClientTests.test_lookupWellKnownServices¬  s5   € ô ×*Ò*¨4¯=©=Ó9ˆØ	�‰�d×&Ñ&¬¯©Ô0Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupPointerr×  râ   rß  r   ÚPTRrç  s   & r.   Útest_lookupPointerÚClientTests.test_lookupPointer´  ó5   € ô × Ò  §¡Ó/ˆØ	�‰�d×&Ñ&¬¯©Ô0Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupHostInfor×  râ   rß  r   ÚHINFOrç  s   & r.   Útest_lookupHostInfoÚClientTests.test_lookupHostInfo¼  s5   € ô ×!Ò! $§-¡-Ó0ˆØ	�‰�d×&Ñ&¬¯	©	Ô2Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupMailboxInfor×  râ   rß  r   ÚMINFOrç  s   & r.   Útest_lookupMailboxInfoÚ"ClientTests.test_lookupMailboxInfoÄ  ó5   € ô ×$Ò$ T§]¡]Ó3ˆØ	�‰�d×&Ñ&¬¯	©	Ô2Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupMailExchanger×  râ   rß  r   ÚMXrç  s   & r.   Útest_lookupMailExchangeÚ#ClientTests.test_lookupMailExchangeÌ  s5   € ô ×%Ò% d§m¡mÓ4ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   Ú
lookupTextr×  râ   rß  r   ÚTXTrç  s   & r.   Útest_lookupTextÚClientTests.test_lookupTextÔ  s5   € ô ×Ò˜dŸm™mÓ,ˆØ	�‰�d×&Ñ&¬¯©Ô0Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupSenderPolicyr×  râ   rß  r   ÚSPFrç  s   & r.   Útest_lookupSenderPolicyÚ#ClientTests.test_lookupSenderPolicyÜ  s5   € ô ×%Ò% d§m¡mÓ4ˆØ	�‰�d×&Ñ&¬¯©Ô0Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupResponsibilityr×  râ   rß  r   ÚRPrç  s   & r.   Útest_lookupResponsibilityÚ%ClientTests.test_lookupResponsibilityä  s5   € ô ×'Ò'¨¯©Ó6ˆØ	�‰�d×&Ñ&¬¯©Ô/Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupAFSDatabaser×  râ   rß  r   ÚAFSDBrç  s   & r.   Útest_lookupAFSDatabaseÚ"ClientTests.test_lookupAFSDatabaseì  r1  r1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupServicer×  râ   rß  r   ÚSRVrç  s   & r.   Útest_lookupServiceÚClientTests.test_lookupServiceô  r&  r1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   Ú
lookupZoner×  râ   rß  r   ÚAXFRrç  s   & r.   Útest_lookupZoneÚClientTests.test_lookupZoneü  r  r1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupAllRecordsr×  râ   rß  r   ÚALL_RECORDSrç  s   & r.   Útest_lookupAllRecordsÚ!ClientTests.test_lookupAllRecords  s5   € ô ×#Ò# D§M¡MÓ2ˆØ	�‰�d×&Ñ&¬¯©Ô8Øˆr1   c                óš   € \         P                  ! V P                  4      pVP                  V P                  \
        P                  4       V# rï  )r   ÚlookupNamingAuthorityPointerr×  râ   rß  r   ÚNAPTRrç  s   & r.   Ú!test_lookupNamingAuthorityPointerÚ-ClientTests.test_lookupNamingAuthorityPointer  s5   € ô ×/Ò/°·±Ó>ˆØ	�‰�d×&Ñ&¬¯	©	Ô2Øˆr1   c                óä   € \         P                  ! V P                  \         P                  4      p\        P
                  ! V4      pVP                  V P                  \         P                  4       V# )zÝ
L{client.query} accepts a L{dns.Query} instance and dispatches
it to L{client.theResolver}.C{query}, which in turn dispatches
to an appropriate C{lookup*} method of L{client.theResolver},
based on the L{dns.Query} type.
)r   rø   r×  r$   r   rS   râ   rß  )r'   rÃ  r  s   &  r.   Ú
test_queryÚClientTests.test_query  sF   € ô �IŠI�d—m‘m¤S§U¡UÓ+ˆÜ�LŠL˜‹OˆØ	�‰�d×&Ñ&¬¯©Ô.Øˆr1   )r×  rØ  N)#r3   r4   r5   r6   rÙ  rÜ  rß  rã  rè  rì  rò  rö  rû  r   r  r
  r  r  r  r  r$  r*  r/  r5  r:  r?  rD  rI  rN  rS  rX  r]  r`  r7   r8   r9   s   @r.   rÓ  rÓ  3  s›   ø‡ € ò=ò"ò-ò.òòòòòòòòòòòòòòòòòòòòòòòò÷
ð 
r1   rÓ  c                   óZ   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )ÚFilterAnswersTestsi!  zp
Test L{twisted.names.client.Resolver.filterAnswers}'s handling of various
error conditions it might encounter.
c                ó@   € \         P                  ! R.R7      V n        R# )ú0.0.0.0rÎ   N)re  rr  )r   rp   r^   r@   s   &r.   rÙ  ÚFilterAnswersTests.setUp'  s   € ô Ÿš°Ð0@ÔAˆŽr1   c                ó  a a€ \         P                  ! RR7      oSP                  R4       VV 3R lpVS P                  n        S P                  P                  S4      pVP                  S P                  R.R.R.34       V# )zN
Test that a truncated message results in an equivalent request made via
TCP.
T)ÚtruncrÕ  c                 óÂ   <€ SP                  V SP                  4       \        P                  ! 4       pR .Vn        R.Vn        R.Vn        \        P                  ! V4      # )rô   r,   r-   )	rq   rI   r   rú   rû   r,   r-   r   r&   )rI   r   Úmr'   s   & €€r.   r®  Ú:FilterAnswersTests.test_truncatedMessage.<locals>.queryTCP4  sO   ø€ Ø×Ñ˜W a§i¡iÔ0Ü—{’{“}ˆHØ (˜zˆHÔØ"- ˆHÔØ#/ .ˆHÔÜ—=’= Ó*Ð*r1   rô   r,   r-   )r   rú   ÚaddQueryr^   r®  ÚfilterAnswersrâ   rq   )r'   r®  r  rj  s   f  @r.   Útest_truncatedMessageÚ(FilterAnswersTests.test_truncatedMessage,  sl   ù€ ô
 �KŠK˜dÔ#ˆØ	�
‰
�>Ô"ö	+ð "*ˆ�‰ÔØ�M‰M×'Ñ'¨Ó*ˆØ	�‰�d×&Ñ&¨(¨°k°]À\ÀNÐ(SÔTØˆr1   c                óŒ   € \         P                  ! VR 7      pV P                  P                  V4      pVP	                  V4       R# ))ÚrCodeN)r   rú   r^   rm  rÁ  )r'   Úrcoderh  rj  re  s   &&&  r.   Ú
_rcodeTestÚFilterAnswersTests._rcodeTestA  s/   € Ü�KŠK˜eÔ$ˆØ�m‰m×)Ñ)¨!Ó,ˆØ�‰�Žr1   c                ó^   € V P                  \        P                  \        P                  4      # )zm
Test that a message with a result code of C{EFORMAT} results in a
failure wrapped around L{DNSFormatError}.
)rs  r   ÚEFORMATr   ÚDNSFormatErrorr@   s   &r.   Útest_formatErrorÚ#FilterAnswersTests.test_formatErrorF  s   € ð
 �‰œsŸ{™{¬E×,@Ñ,@ÓAÐAr1   c                ó^   € V P                  \        P                  \        P                  4      # )z@
Like L{test_formatError} but for C{ESERVER}/L{DNSServerError}.
)rs  r   ÚESERVERr   ÚDNSServerErrorr@   s   &r.   Útest_serverErrorÚ#FilterAnswersTests.test_serverErrorM  s   € ð �‰œsŸ{™{¬E×,@Ñ,@ÓAÐAr1   c                ó^   € V P                  \        P                  \        P                  4      # )z<
Like L{test_formatError} but for C{ENAME}/L{DNSNameError}.
)rs  r   ÚENAMEr   ÚDNSNameErrorr@   s   &r.   Útest_nameErrorÚ!FilterAnswersTests.test_nameErrorS  s   € ð �‰œsŸy™y¬%×*<Ñ*<Ó=Ð=r1   c                ó^   € V P                  \        P                  \        P                  4      # )zH
Like L{test_formatError} but for C{ENOTIMP}/L{DNSNotImplementedError}.
)rs  r   ÚENOTIMPr   ÚDNSNotImplementedErrorr@   s   &r.   Útest_notImplementedErrorÚ+FilterAnswersTests.test_notImplementedErrorY  s   € ð �‰œsŸ{™{¬E×,HÑ,HÓIÐIr1   c                ó^   € V P                  \        P                  \        P                  4      # )zG
Like L{test_formatError} but for C{EREFUSED}/L{DNSQueryRefusedError}.
)rs  r   ÚEREFUSEDr   ÚDNSQueryRefusedErrorr@   s   &r.   Útest_refusedErrorÚ$FilterAnswersTests.test_refusedError_  s   € ð �‰œsŸ|™|¬U×-GÑ-GÓHÐHr1   c                ól   € V P                  \        P                  ^,           \        P                  4      # )zU
Like L{test_formatError} but for an unrecognized error code and
L{DNSUnknownError}.
)rs  r   rŠ  r   ÚDNSUnknownErrorr@   s   &r.   Útest_refusedErrorUnknownÚ+FilterAnswersTests.test_refusedErrorUnknowne  s$   € ð
 �‰œsŸ|™|¨aÕ/´×1FÑ1FÓGÐGr1   )r^   N)r3   r4   r5   r6   rC   rÙ  rn  rs  rx  r}  r‚  r‡  rŒ  r�  r7   r8   r9   s   @r.   rc  rc  !  sC   ø‡ € ñò
Bò
ò*ò
BòBò>òJòI÷Hð Hr1   rc  c                   ó6   a € ] tR tRt o R tRR ltR tRtV tR# )ÚFakeDNSDatagramProtocolim  c                ó2   € . V n         \        4       V n        R # rG   rH   r@   s   &r.   rK   Ú FakeDNSDatagramProtocol.__init__n  rM   r1   Nc                ó�   € V P                   P                  WW434       \        P                  ! \        P
                  ! V4      4      # rG   )rI   rP   r   ry  r   r   )r'   r   rI   r)   rQ   s   &&&&&r.   rS   ÚFakeDNSDatagramProtocol.queryr  s3   € Ø�‰×Ñ˜W¨wÐ;Ô<Ü�zŠzœ%×4Ò4°WÓ=Ó>Ð>r1   c                ó   € R # rG   r2   )r'   rQ   s   &&r.   ÚremoveResendÚ$FakeDNSDatagramProtocol.removeResendv  s   € ár1   rU   rV   )	r3   r4   r5   r6   rK   rS   r™  r7   r8   r9   s   @r.   r“  r“  m  s   ø‡ € ò$ô?÷ð r1   r“  c                   ó>   a € ] tR tRt o Rt. ROtR tR tR tRt	V t
R# )	ÚRetryLogicTestsi{  z=
Tests for query retrying implemented by L{client.Resolver}.
c                ó(  a€ V P                    Uu. uF  q^53NK  	  pp\        P                  ! RVR7      p\        4       oV3R lVn        VP                  R4      P                  V P                  4      P                  V P                  S4      # u upi )zê
When timeouts occur waiting for responses to queries, the next
configured server is issued the query.  When the query has been issued
to all configured servers, the timeout is increased and the process
begins again at the beginning.
N)r‡   rŸ   c                  ó   <€ S # rG   r2   )r,  s   €r.   rÛ   Ú8RetryLogicTests.test_roundRobinBackoff.<locals>.<lambda>Œ  s   ø€ ¡ur1   rî   )
ÚtestServersr   rp   r“  rß   rë  râ   Ú_cbRoundRobinBackoffrÆ  Ú_ebRoundRobinBackoff)r'   ÚxÚaddrsrv   r,  s   &   @r.   Útest_roundRobinBackoffÚ&RetryLogicTests.test_roundRobinBackoff‚  s|   ø€ ð #'×"2Ò"2Ó3Ñ"2˜Q�R“Ñ"2ˆÐ3Ü�OŠO 4°Ô7ˆÜ'Ó)ˆÜ,ˆÔà�O‰OÐ.Ó/ß‰[˜×2Ñ2Ó3ß‰Z˜×1Ñ1°5Ó9ð	
ùò	 4s   �Bc                ó(   € V P                  R 4       R# )z/Lookup address succeeded, should have timed outN)ry  râ  s   &&r.   r¡  Ú$RetryLogicTests._cbRoundRobinBackoff“  s   € Ø�	‰	ÐCÖDr1   c                óø  € VP                   ! \        P                  4       R F¸  pVP                  R\	        V P
                  4       pVP                  R\	        V P
                  4      1 VP                  4        \        V P
                  4      pVP                  4        \        WE4       F-  w  w  rgr‰p
V P                  Wj^534       V P                  Wƒ4       K/  	  Kº  	  V P                  VP                  4       R# )rm   N)rm   é   é   é-   )rÁ  r   ÚTimeoutErrorrI   rr   r   ÚsortÚlistÚziprq   rˆ  )r'   r   Ú	fakeProtoÚtÚtriesÚexpectedÚaddrrS   r)   rQ   ÚexpectedAddrs   &&&        r.   r¢  Ú$RetryLogicTests._ebRoundRobinBackoff–  sÐ   € Ø�Š”U×'Ñ'Ô(ó
  ˆAØ×%Ñ%Ð&=¬¨D×,<Ñ,<Ó(=Ð>ˆEØ×!Ñ!Ð"9¤C¨×(8Ñ(8Ó$9Ð"9Ð:à�J‰JŒLÜ˜D×,Ñ,Ó-ˆHØ�M‰MŒOä<?ÀÖ<PÑ8Ñ*�˜g¨LØ× Ñ  °bÐ'9Ô:Ø× Ñ  Ö,ó =Qñ  ð 	×Ñ˜×*Ñ*Ö+r1   r2   N)z1.2.3.4z4.3.2.1za.b.c.dzz.y.x.w)r3   r4   r5   r6   rC   r   r¥  r¡  r¢  r7   r8   r9   s   @r.   rœ  rœ  {  s&   ø‡ € ñò ?€Kò
ò"E÷,ð ,r1   rœ  c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚThreadedResolverTestsi«  z'
Tests for L{client.ThreadedResolver}.
c                ó(  € \         P                  ! 4        V P                  V P                  .R7      pV P	                  V^ ,          R,          R4       V P	                  V^ ,          R,          \
        4       V P	                  \        V4      ^4       R# )z‹
L{client.ThreadedResolver} is deprecated.  Instantiating it emits a
deprecation warning pointing at the code that does the instantiation.
)ÚoffendingFunctionsÚmessagezztwisted.names.client.ThreadedResolver is deprecated since Twisted 9.0, use twisted.internet.base.ThreadedResolver instead.ÚcategoryN)r   ÚThreadedResolverÚflushWarningsÚtest_deprecatedrq   ÚDeprecationWarningrr   )r'   Úwarningss   & r.   rÀ  Ú%ThreadedResolverTests.test_deprecated°  s{   € ô
 	×ÒÔ!Ø×%Ñ%¸$×:NÑ:NÐ9OÐ%ÓPˆØ×ÑØ�Q�K˜	Õ"ðô	
ð 	×Ñ˜ !� ZÕ0Ô2DÔEØ×Ñœ˜X›¨Ö*r1   r2   N)r3   r4   r5   r6   rC   rÀ  r7   r8   r9   s   @r.   r¹  r¹  «  s   ø‡ € ñ÷+ð +r1   r¹  )6rC   rc  Úzope.interface.verifyr   r   Útwisted.internetr   Útwisted.internet.errorr   r   Útwisted.internet.interfacesr   Útwisted.internet.taskr   Ú#twisted.internet.test.modulehelpersr	   Útwisted.namesr
   r   r   r   r   Útwisted.names.commonr   Útwisted.names.errorr   Útwisted.names.testr   Útwisted.names.test.test_hostsr   Útwisted.pythonr   Útwisted.python.filepathr   Útwisted.python.runtimer   Útwisted.testr   Útwisted.trialr   Ú	isWindowsrg   r   r<   rE   ÚTestCaserY   rj   r¬   rÓ  rc  r“  rœ  r¹  r2   r1   r.   Ú<module>rÖ     s  ðñó
 ç ;å "ß LÝ 1Ý 'Ý @ß :Õ :Ý -Ý 4Ý (Ý ;Ý "Ý ,Ý +Ý &Ý "à×Ò×ÒØ�KàN€Kô?�<ô ?÷0!ñ !÷ñ ô.�x×(Ñ(ô ô4o&˜(×+Ñ+Ð->ô o&ôdC	-�H×%Ñ%ô C	-ôLk�(×#Ñ#ô kô\IH˜×*Ñ*ô IH÷Xñ ô-,�h×'Ñ'ô -,ô`+˜H×-Ñ-ö +r1   