+
    üÐj2d  ã                   óÐ  € R t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	 ^ RI
Ht ^ RIHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHtHtHtHt ^ RIHt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 t,R t- ! R R]+4      t. ! R R]/4      t0R t1 ! R R]+4      t2. ROt3]! ]4       ! R R4      4       t4]! ]]44        ! R R]*4      t5 ! R R4      t6](Pn                  ! ]8RR7      t9R# ) z.
Test cases for Twisted.names' root resolver.
)Úimplementer)ÚverifyClass)ÚDeferredÚTimeoutErrorÚgatherResultsÚsucceed)ÚIResolverSimple)ÚclientÚroot)ÚCNAMEÚENAMEÚHSÚINÚNSÚOKÚAÚMessageÚNameÚQueryÚRecord_AÚRecord_CNAMEÚ	Record_NSÚRRHeader)ÚDNSNameErrorÚResolverError)ÚResolver)ÚMemoryReactor)Úmsg)Úutil)ÚSynchronousTestCaseÚTestCasec                ó2   € V w  rpV^ ,          P                   # )zˆ
From the result of a L{Deferred} returned by L{IResolver.lookupAddress},
return the payload of the first record in the answer section.
©Úpayload©ÚresultsÚansÚauthÚadds   &   ÚE/usr/lib/python3/dist-packages/twisted/names/test/test_rootresolve.pyÚgetOnePayloadr*   &   s   € ð
 �N€CˆsØˆq�6�>‰>Ðó    c                ó4   € \        V 4      P                  4       # )z�
From the result of a L{Deferred} returned by L{IResolver.lookupAddress},
return the first IPv4 address from the answer section.
)r*   Ú
dottedQuad©r%   s   &r)   ÚgetOneAddressr/   /   s   € ô
 ˜Ó!×,Ñ,Ó.Ð.r+   c                   óš   a € ] tR t^7t o RtR tR tR t. . . ]3R lt	RR l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# )ÚRootResolverTestsz+
Tests for L{twisted.names.root.Resolver}.
c                ó`  € \        4       p\        . VR7      pVP                  \        R\        \
        4      R.RV4      pVP                  P                  4       w  rVVP                  w  w  rx\        4       p	V	P                  V4       V P                  V	P                  \        R\        \
        4      .4       V P                  V	P                  . 4       V P                  V	P                  . 4       V P                  V	P                  . 4       . p
VP!                  V
P"                  4       V P                  V
. 4       V	P                  R ^V	n        V	P                  P#                  \'        R\)        R4      R7      4       VP*                  P-                  V	P/                  4       R4       V
^ ,          # )a  
Invoke L{Resolver._query} and verify that it sends the correct DNS
query.  Deliver a canned response to the query and return whatever the
L{Deferred} returned by L{Resolver._query} fires with.

@param filter: The value to pass for the C{filter} parameter to
    L{Resolver._query}.
)Úreactoró   foo.example.com:NNNú	5.8.13.21r"   )ú1.1.2.3i  )é   )r   r   Ú_queryr   r   r   ÚudpPortsÚpopitemÚ_sentPacketsr   ÚfromStrÚassertEqualÚqueriesÚanswersÚ	authorityÚ
additionalÚaddCallbackÚappendÚanswerr   r   Ú	_protocolÚdatagramReceivedÚtoStr)ÚselfÚfilterr3   ÚresolverÚdÚ
portNumberÚ	transportÚpacketÚaddressÚmessageÚresponses   &&         r)   Ú
_queryTestÚRootResolverTests._queryTest<   sc  € ô  “/ˆÜ˜B¨Ô0ˆØ�O‰OÜÐ$¤a¬Ó,Ð/@Ð.AÀ5È&ó
ˆð
 !(× 0Ñ 0× 8Ñ 8Ó :Ñˆ
ð (×4Ñ4ÑÑ	ˆ&ä“)ˆØ�‰˜Ôð 	×Ñ˜Ÿ™¬5Ð1CÄQÌÓ+KÐ*LÔMØ×Ñ˜Ÿ™¨"Ô-Ø×Ñ˜×*Ñ*¨BÔ/Ø×Ñ˜×+Ñ+¨RÔ0àˆØ	�‰�h—o‘oÔ&Ø×Ñ˜ 2Ô&ð �O‰O˜AÐØˆŒØ�‰×ÑÜÐ'´¸+Ó1FÔGô	
ð 	×Ñ×,Ñ,¨W¯]©]«_Ð>OÔPØ˜�{Ðr+   c                óÈ   € V P                  R4      w  rpV P                  V\        R\        R^ R7      R7      .4       V P                  V. 4       V P                  V. 4       R# )a  
L{Resolver._query} accepts a L{Query} instance and an address, issues
the query, and returns a L{Deferred} which fires with the response to
the query.  If a true value is passed for the C{filter} parameter, the
result is a three-tuple of lists of records.
Tr4   r5   ©Úttlr"   N)rR   r=   r   r   )rH   rD   r@   rA   s   &   r)   Útest_filteredQueryÚ$RootResolverTests.test_filteredQueryg   s_   € ð )-¯©¸Ó(=Ñ%ˆ˜:Ø×ÑØ”XÐ0¼(À;ÐTUÔ:VÔWÐXô	
ð 	×Ñ˜ BÔ'Ø×Ñ˜ RÖ(r+   c                ób  € V P                  R4      pV P                  V\        4       V P                  VP                  . 4       V P                  VP
                  \        R\        R^ R7      R7      .4       V P                  VP                  . 4       V P                  VP                  . 4       R# )z£
Similar to L{test_filteredQuery}, but for the case where a false value
is passed for the C{filter} parameter.  In this case, the result is a
L{Message} instance.
Fr4   r5   rU   r"   N)
rR   ÚassertIsInstancer   r=   r>   r?   r   r   r@   rA   )rH   rP   s   & r)   Útest_unfilteredQueryÚ&RootResolverTests.test_unfilteredQueryu   sŽ   € ð —/‘/ %Ó(ˆØ×Ñ˜g¤wÔ/Ø×Ñ˜Ÿ™¨"Ô-Ø×ÑØ�O‰OÜÐ(´(¸;ÈAÔ2NÔOÐPô	
ð 	×Ñ˜×*Ñ*¨BÔ/Ø×Ñ˜×+Ñ+¨RÖ0r+   c                ó"  € \        VR7      pVP                  V3VP                  V3VP                  V33 FO  w  rgTP	                  V UU	u. uF,  w  r‰\        W‰P                  \        V	R\        4      V	R7      NK.  	  up	p4       KQ  	  V# u up	pi )aK  
Create a L{Message} suitable for use as a response to a query.

@param answers: A C{list} of two-tuples giving data for the answers
    section of the message.  The first element of each tuple is a name
    for the L{RRHeader}.  The second element is the payload.
@param authority: A C{list} like C{answers}, but for the authority
    section of the response.
@param additional: A C{list} like C{answers}, but for the
    additional section of the response.
@param rCode: The response code the message will be created with.

@return: A new L{Message} initialized with the given values.
)ÚrCodeÚCLASSr"   )	r   r?   r@   rA   Úextendr   ÚTYPEÚgetattrr   )
rH   r?   r@   rA   r^   rQ   ÚsectionÚdataÚnameÚrecords
   &&&&&     r)   Ú_respondÚRootResolverTests._respond…   s�   € ô  Ô'ˆà×Ñ˜wÐ'Ø×Ñ Ð+Ø× Ñ  *Ð-ó
‰MˆGð
 �N‰Nñ
 +/ô	ñ +/™˜ô ØŸk™k¬7°6¸7ÄBÓ+GÐQW÷ñ +/ò	öñ
ð ˆùós   Á2Bc                ó@   a a€ R.p\        W24      pV V3R lpWTn        V# )ah  
Create and return a new L{root.Resolver} modified to resolve queries
against the record data represented by C{servers}.

@param serverResponses: A mapping from dns server addresses to
    mappings.  The inner mappings are from query two-tuples (name,
    type) to dictionaries suitable for use as **arguments to
    L{_respond}.  See that method for details.
r6   c                 ó  <€ \        R V P                   RV: 24       V FP  p SV,          pYPP                  P                  T P                  3,          p\	        SP
                  ! R/ TB 4      u # 	  R#   \         d     Kd  i ; i)zQuery for QNAME z at N© )r   re   ÚKeyErrorÚtyper   rg   )	ÚqueryÚserverAddressesÚtimeoutrI   ÚaddrÚserverÚrecordsrH   ÚserverResponsess	   &&&&   €€r)   rn   Ú-RootResolverTests._getResolver.<locals>.query±   s}   ø€ ÜÐ" 5§:¡: ,¨d°?Ñ2EÐFÔGÛ'�ðØ,¨TÕ2�Fð !§¡§¡°%·*±*Ð!<Õ=�Ü˜tŸ}š}Ñ7¨wÑ7Ó8Ò8ó (øô  ô Úðús   ¤	A6Á6BÂB)r   r8   )rH   rt   ÚmaximumQueriesÚrootsrJ   rn   s   ff&   r)   Ú_getResolverÚRootResolverTests._getResolver¤   s'   ù€ ð �ˆÜ˜EÓ2ˆö	9ð  ŒØˆr+   c           	     ó,  € RR\         3RR\        R4      3.RR\        R4      3.//R	R\         3RR\        R4      3.///pV P                  V4      pVP	                  R4      pVP                  \        4       VP                  V P                  R4       V# )
zæ
L{root.Resolver.lookupAddress} looks up the I{A} records for the
specified hostname by first querying one of the root servers the
resolver was created with and then following the authority delegations
until a result is received.
r4   r@   ó   ns1.example.comrA   ú34.55.89.144r?   ú10.0.0.1©r6   é5   )r|   r   ©r   r   r   rx   ÚlookupAddressrB   r/   r=   ©rH   ÚserversrJ   rK   s   &   r)   Útest_lookupAddressÚ$RootResolverTests.test_lookupAddress¾   s¹   € ð Ø#¤QÐ'ØÐ#5´yÐASÓ7TÐ"UÐ!VØ Ð$6¼ÀÓ8PÐ#QÐ"Rð*ðð !Ø#¤QÐ'ØÐ!3´X¸jÓ5IÐ JÐKð*ð#ð
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ"Ð#5Ó6ˆØ	�‰”mÔ$Ø	�‰�d×&Ñ&¨
Ô3Øˆr+   c                ót  € \        R4      p\        Vn        R	R\        3RRV3.RR\	        R4      3.RR\        R4      3.//R
R\        3RR\        R4      3.///pV P                  V4      pVP                  R4      pVP                  \        4       VP                  V P                  \        R4      4       V# )z¤
If a response includes a record with a class different from the one
in the query, it is ignored and lookup continues until a record with
the right class is found.
r}   r4   r?   r@   r{   rA   ú10.0.0.2ú10.0.0.3r~   ©r‡   r   )
r   r   r_   r   r   rx   r�   rB   r*   r=   )rH   ÚbadClassrƒ   rJ   rK   s   &    r)   Útest_lookupChecksClassÚ(RootResolverTests.test_lookupChecksClassØ   sÝ   € ô ˜JÓ'ˆÜˆŒàØ#¤QÐ'ØÐ!3°XÐ >Ð?ØÐ#5´yÐASÓ7TÐ"UÐ!VØ Ð$6¼ÀÓ8LÐ#MÐ"Nð*ðð Ø#¤QÐ'ØÐ!3´X¸jÓ5IÐ JÐKð*ðð
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ"Ð#5Ó6ˆØ	�‰”mÔ$Ø	�‰�d×&Ñ&¬°Ó(<Ô=Øˆr+   c           	     ó<  € RR\         3RR\        R4      3./R\         3RR\        R4      3.//RR\         3RR\        R4      3.///pV P                  V4      pVP	                  R4      pVP                  \        4       VP                  V P                  R4       V# )	z~
If an intermediate response includes no glue records for the
authorities, separate queries are made to find those addresses.
r4   r@   s   ns1.example.orgr?   r}   r‡   r~   )r}   r   r€   r‚   s   &   r)   Útest_missingGlueÚ"RootResolverTests.test_missingGlueô   sÈ   € ð Ø#¤QÐ'ØÐ#5´yÐASÓ7TÐ"UÐ!Vð*ð $¤QÐ'ØÐ!3´X¸jÓ5IÐ JÐKð*ðð Ø#¤QÐ'ØÐ!3´X¸jÓ5IÐ JÐKð*ðð
ˆð  ×$Ñ$ WÓ-ˆØ×"Ñ"Ð#5Ó6ˆØ	�‰”mÔ$Ø	�‰�d×&Ñ&¨
Ô3Øˆr+   c                ó–   € RR\         3R\        ///pV P                  V4      pVP                  R4      pV P	                  V\
        4      # )zi
If a name is missing, L{Resolver.lookupAddress} returns a L{Deferred}
which fails with L{DNSNameError}.
r4   r^   r~   )r   r   rx   r�   ÚassertFailurer   r‚   s   &   r)   Útest_missingNameÚ"RootResolverTests.test_missingName  s[   € ð Ø#¤QÐ'ØœUð*ðð
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ"Ð#5Ó6ˆØ×!Ñ! !¤\Ó2Ð2r+   c                óŠ   € RR\         3/ //pV P                  V4      pVP                  R4      pV P                  V\        4      # )z–
If a query is responded to with no answers or nameserver records, the
L{Deferred} returned by L{Resolver.lookupAddress} fires with
L{ResolverError}.
ó   example.comr~   )r   rx   r�   r‘   r   r‚   s   &   r)   Útest_answerlessÚ!RootResolverTests.test_answerless  sR   € ð Ø¤Ð# Rðð
ˆð
 ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ×!Ñ! !¤]Ó3Ð3r+   c                óÂ   € RR\         3RR\        R4      3./R\         3R\        ///pV P                  V4      pVP	                  R4      pV P                  V\        4      # )z–
If there is an error resolving the nameserver in a delegation response,
the L{Deferred} returned by L{Resolver.lookupAddress} fires with that
error.
r•   r@   r{   r^   r~   )r   r   r   rx   r�   r‘   r   r‚   s   &   r)   Útest_delegationLookupErrorÚ,RootResolverTests.test_delegationLookupError.  s|   € ð Ø¤Ð#Ø >´9Ð=OÓ3PÐ"QÐ!Rð&ð $¤QÐ'ØœUð*ð	ð	
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ×!Ñ! !¤\Ó2Ð2r+   c                ó¶   € RR\         3RR\        R4      3./R\         3/ //pV P                  V4      pVP                  R4      pV P	                  V\
        4      # )z¤
If there are no records in the response to a lookup of a delegation
nameserver, the L{Deferred} returned by L{Resolver.lookupAddress} fires
with L{ResolverError}.
r•   r@   r{   r~   )r   r   rx   r�   r‘   r   r‚   s   &   r)   Útest_delegationLookupEmptyÚ,RootResolverTests.test_delegationLookupEmptyB  st   € ð Ø¤Ð#Ø >´9Ð=OÓ3PÐ"QÐ!Rð&ð $¤QÐ'¨ð	ð
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ×!Ñ! !¤]Ó3Ð3r+   c           	     ó  € RR\         3R\        /R\        3RR\        R4      3.///pV P	                  V4      pVP                  R4      pR pVP                  V4       VP                  V P                  \        R4      4       V# )z
L{Resolver.lookupNameservers} is like L{Resolver.lookupAddress}, except
it queries for I{NS} records instead of I{A} records.
r•   r^   r?   r{   c                 óF   € V w  rpV^ ,          P                   P                  # ©é    )r#   re   r$   s   &   r)   Ú
getOneNameÚ<RootResolverTests.test_lookupNameservers.<locals>.getOneNamef  s   € Ø$‰NˆC�sØ�q•6—>‘>×&Ñ&Ð&r+   r~   )	r   r   r   r   rx   ÚlookupNameserversrB   r=   r   )rH   rƒ   rJ   rK   r¢   s   &    r)   Útest_lookupNameserversÚ(RootResolverTests.test_lookupNameserversT  s›   € ð Ø¤Ð#ØœUð&ð  ¤Ð$Ø ´Ð;MÓ1NÐ OÐPð'ð	ð	
ˆð ×$Ñ$ WÓ-ˆØ×&Ñ& ~Ó6ˆò	'ð 	
�‰�jÔ!Ø	�‰�d×&Ñ&¬Ð-?Ó(@ÔAØˆr+   c                óZ  € RR\         3RR\        R4      3R\        R4      3.///pV P                  V4      pVP	                  R4      pVP                  R 4       VP                  V P                  \        R\        \        R4      R7      \        R\         \        R4      R7      .4       V# )z~
If a I{CNAME} record is encountered as the answer to a query for
another record type, that record is returned as the answer.
r•   r?   ó   example.netz10.0.0.7c                 ó   € V ^ ,          # r    rk   r.   s   &r)   Ú<lambda>Ú<RootResolverTests.test_returnCanonicalName.<locals>.<lambda>  ó   €  g¨a¦jr+   r"   r~   ©	r   r   r   rx   r�   rB   r=   r   r   r‚   s   &   r)   Útest_returnCanonicalNameÚ*RootResolverTests.test_returnCanonicalNamen  s´   € ð Ø¤Ð#ØØ'¬°nÓ)EÐFØ'¬°*Ó)=Ð>ð ð&ðð	
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ	�‰Ñ0Ô1Ø	�‰Ø×Ñä˜¬¼À^Ó8TÔUÜ˜¬´H¸ZÓ4HÔIðô	
ð ˆr+   c                ón  € RR\         3RR\        R4      3./R\         3RR\        R4      3.///pV P                  V4      pVP	                  R4      pVP                  R 4       VP                  V P                  \        R\        \        R4      R7      \        R\         \        R4      R7      .4       V# )z¬
If no record of the requested type is included in a response, but a
I{CNAME} record for the query name is included, queries are made to
resolve the value of the I{CNAME}.
r•   r?   r¨   z10.0.0.5c                 ó   € V ^ ,          # r    rk   r.   s   &r)   rª   Ú<RootResolverTests.test_followCanonicalName.<locals>.<lambda>›  r¬   r+   r"   r~   r­   r‚   s   &   r)   Útest_followCanonicalNameÚ*RootResolverTests.test_followCanonicalName‰  sÅ   € ð Ø¤Ð#Ø ´¸nÓ1MÐ NÐOð&ð  ¤Ð#Ø ´¸*Ó1EÐ FÐGð&ð	ð	
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ	�‰Ñ0Ô1Ø	�‰Ø×Ñä˜¬¼À^Ó8TÔUÜ˜¬´H¸ZÓ4HÔIðô	
ð ˆr+   c                ó¾   € RR\         3RR\        R4      3R\        R4      3.///pV P                  V4      pVP                  R4      pV P	                  V\
        4      # )z�
If there is a cycle between I{CNAME} records in a response, this is
detected and the L{Deferred} returned by the lookup method fails
with L{ResolverError}.
r•   r?   r¨   r~   )r   r   rx   r�   r‘   r   r‚   s   &   r)   Útest_detectCanonicalNameLoopÚ.RootResolverTests.test_detectCanonicalNameLoop¥  sw   € ð Ø¤Ð#ØØ'¬°nÓ)EÐFØ'¬°nÓ)EÐFð ð&ðð	
ˆð ×$Ñ$ WÓ-ˆØ×"Ñ" >Ó2ˆØ×!Ñ! !¤]Ó3Ð3r+   c                ó  € R
R\         3RR\        R4      3./R\         3RR\        R4      3.//RR\         3RR\        R4      3.RR\        R4      3.//RR\         3RR\        R	4      3.///pV P                  V^4      pV P	                  VP                  R4      \        4      pV P                  V^4      pVP                  R4      pVP                  \        4       VP                  V P                  \        R	4      4       \        W5.4      # )zt
L{Resolver.lookupAddress} won't issue more queries following
delegations than the limit passed to its initializer.
r•   r@   r{   r?   r‡   s   ns2.example.comrA   rˆ   z10.0.0.4r~   r‰   )rˆ   r   )r   r   r   rx   r‘   r�   r   rB   r*   r=   r   )rH   rƒ   ÚfailerÚfailDÚ	succeederÚsucceedDs   &     r)   Útest_boundedQueriesÚ%RootResolverTests.test_boundedQueries¹  sJ  € ð ð  ¤Ð#Ø >´9Ð=OÓ3PÐ"QÐ!Rð&ð
 $¤QÐ'ØÐ!3´X¸jÓ5IÐ JÐKð*ðð ð  ¤Ð#Ø >´9Ð=OÓ3PÐ"QÐ!RØ Ð$6¼ÀÓ8LÐ#MÐ"Nð&ð	ð à¤Ð#Ø ´¸*Ó1EÐ FÐGð&ðð-
ˆðB ×"Ñ" 7¨AÓ.ˆØ×"Ñ" 6×#7Ñ#7¸Ó#GÌÓWˆà×%Ñ% g¨qÓ1ˆ	Ø×*Ñ*¨>Ó:ˆØ×Ñœ]Ô+Ø×Ñ˜T×-Ñ-¬x¸
Ó/CÔDä˜eÐ.Ó/Ð/r+   rk   N)é
   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rR   rW   r[   r   rg   rx   r„   r‹   rŽ   r’   r–   r™   rœ   r¥   r®   r³   r¶   r½   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r)   r1   r1   7   sp   ø‡ € ñò)òV)ò1ð   "¨R¸BÀbô ô>ò4ò4ò8ò63ò 4ò3ò(4ò$ò4ò6ò84÷(.0ð .0r+   r1   c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚResolverFactoryArgumentsiê  zZ
Raised by L{raisingResolverFactory} with the *args and **kwargs passed to
that function.
c                ó   € Wn         W n        R# )zy
Store the supplied args and kwargs as attributes.

@param args: Positional arguments.
@param kwargs: Keyword arguments.
N©ÚargsÚkwargs)rH   rÍ   rÎ   s   &&&r)   Ú__init__Ú!ResolverFactoryArguments.__init__ð  s   € ð Œ	ØŽr+   rÌ   N)rÀ   rÁ   rÂ   rÃ   rÄ   rÏ   rÅ   rÆ   rÇ   s   @r)   rÊ   rÊ   ê  s   ø‡ € ñ÷
ð r+   rÊ   c                 ó   € \        W4      h)a!  
Raise a L{ResolverFactoryArguments} exception containing the
positional and keyword arguments passed to resolverFactory.

@param args: A L{list} of all the positional arguments supplied by
    the caller.

@param kwargs: A L{list} of all the keyword arguments supplied by
    the caller.
)rÊ   rÌ   s   *,r)   ÚraisingResolverFactoryrÒ   û  s   € ô # 4Ó
0Ð0r+   c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )Ú RootResolverResolverFactoryTestsi	  z.
Tests for L{root.Resolver._resolverFactory}.
c                ój   € \        R.\        R7      pV P                  VP                  \        4       R# )zm
L{root.Resolver.__init__} accepts a C{resolverFactory}
argument and assigns it to C{self._resolverFactory}.
N)ÚhintsÚresolverFactory)r   rÒ   ÚassertIsÚ_resolverFactory©rH   Úrs   & r)   Ú#test_resolverFactoryArgumentPresentÚDRootResolverResolverFactoryTests.test_resolverFactoryArgumentPresent  s(   € ô
 ˜D˜6Ô3IÔJˆØ�‰�a×(Ñ(Ô*@ÖAr+   c                ót   € \        R.R7      pV P                  VP                  \        P                   4       R# )z€
L{root.Resolver.__init__} sets L{client.Resolver} as the
C{_resolverFactory} if a C{resolverFactory} argument is not
supplied.
N)rÖ   )r   rØ   rÙ   r	   rÚ   s   & r)   Ú"test_resolverFactoryArgumentAbsentÚCRootResolverResolverFactoryTests.test_resolverFactoryArgumentAbsent  s(   € ô ˜D˜6Ô"ˆØ�‰�a×(Ñ(¬&¯/©/Ö:r+   c                óà   € \        4       p\        R.\        VR7      pV P                  \        VP
                  R4      pV P                  RRVRR./3VP                  VP                  34       R# )	za
L{root.Resolver._resolverFactory} is supplied with C{reactor} and
C{servers} keyword arguments.
ú192.0.2.101)rÖ   r×   r3   zexample.comr3   rƒ   Nrk   )râ   r   )	Úobjectr   rÒ   ÚassertRaisesrÊ   r�   r=   rÍ   rÎ   )rH   ÚdummyReactorrÛ   Úes   &   r)   Ú)test_resolverFactoryOnlyExpectedArgumentsÚJRootResolverResolverFactoryTests.test_resolverFactoryOnlyExpectedArguments  sn   € ô
 “xˆÜØ �/Ü2Ø ô
ˆð ×ÑÔ6¸¿¹ÈÓWˆà×ÑØ�)˜\¨9Ð7JÐ6KÐLÐMØ�V‰V�Q—X‘XÐö	
r+   rk   N)
rÀ   rÁ   rÂ   rÃ   rÄ   rÜ   rß   rç   rÅ   rÆ   rÇ   s   @r)   rÔ   rÔ   	  s   ø‡ € ñòBò;÷
ð 
r+   rÔ   c                   ó0   a € ] tR tRt o RtR tR tRtV tR# )ÚStubResolveriD  z¢
An L{IResolverSimple} implementer which traces all getHostByName
calls and their deferred results. The deferred results can be
accessed and fired synchronously.
c                ó"   € . V n         . V n        R# )zº
@type calls: L{list} of L{tuple} containing C{args} and
    C{kwargs} supplied to C{getHostByName} calls.
@type pendingResults: L{list} of L{Deferred} returned by
    C{getHostByName}.
N©ÚcallsÚpendingResults)rH   s   &r)   rÏ   ÚStubResolver.__init__L  s   € ð ˆŒ
Ø ˆÖr+   c                óˆ   € V P                   P                  W34       \        4       pV P                  P                  V4       V# )a,  
A fake implementation of L{IResolverSimple.getHostByName}

@param args: A L{list} of all the positional arguments supplied by
   the caller.

@param kwargs: A L{list} of all the keyword arguments supplied by
   the caller.

@return: A L{Deferred} which may be fired later from the test
    fixture.
)rí   rC   r   rî   )rH   rÍ   rÎ   rK   s   &*, r)   ÚgetHostByNameÚStubResolver.getHostByNameV  s8   € ð 	�
‰
×Ñ˜4˜.Ô)Ü‹JˆØ×Ñ×"Ñ" 1Ô%Øˆr+   rì   N)	rÀ   rÁ   rÂ   rÃ   rÄ   rÏ   rñ   rÅ   rÆ   rÇ   s   @r)   rê   rê   D  s   ø‡ € ñò!÷ð r+   rê   c                   óN   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V tR# )ÚBootstrapTestsil  z
Tests for L{root.bootstrap}
c                ó‚   € \         P                  ! \        4       4      pV P                  V\         P                  4       R# )zT
L{root.bootstrap} returns an object which is initially a
L{root.DeferredResolver}.
N)r
   Ú	bootstraprê   rZ   ÚDeferredResolver)rH   ÚdeferredResolvers   & r)   Útest_returnsDeferredResolverÚ+BootstrapTests.test_returnsDeferredResolverq  s,   € ô
  Ÿ>š>¬,«.Ó9ÐØ×ÑÐ.´×0EÑ0EÖFr+   c                ó´   € \        4       p\        P                  ! V4       T P                  VP                  \
         Uu. uF  q"3/ 3NK	  	  up4       R# u upi )zv
The L{IResolverSimple} supplied to L{root.bootstrap} is used to lookup
the IP addresses of the 13 root name servers.
N)rê   r
   rö   r=   rí   ÚROOT_SERVERS)rH   ÚstubResolverÚss   &  r)   Útest_resolves13RootServersÚ)BootstrapTests.test_resolves13RootServersy  sC   € ô
 $“~ˆÜ�Š�|Ô$Ø×Ñ˜×+Ñ+Å,Ó-OÁ,¸Q¨t°R«jÁ,Ñ-OÖPùÒ-Os   ¿A
c                óº   € \        4       p\        P                  ! V4      pVP                   F  pVP	                  R4       K  	  V P                  V\        4       R# )z§
The L{root.DeferredResolver} initially returned by L{root.bootstrap}
becomes a L{root.Resolver} when the supplied resolver has successfully
looked up all root hints.
râ   N)rê   r
   rö   rî   ÚcallbackrZ   r   ©rH   rý   rø   rK   s   &   r)   Útest_becomesResolverÚ#BootstrapTests.test_becomesResolver‚  sG   € ô $“~ˆÜŸ>š>¨,Ó7ÐØ×,Ô,ˆAØ�J‰J�}Ö%ñ -à×ÑÐ.´Ö9r+   c                óÖ   € \        4       p\        P                  ! V4      pVP                   F  pVP	                  R4       K  	  V P                  VP                  R.^,          4       R# )zƒ
The L{root.Resolver} which eventually replaces L{root.DeferredResolver}
is supplied with the IP addresses of the 13 root servers.
râ   N)rê   r
   rö   rî   r  r=   rÖ   r  s   &   r)   Útest_resolverReceivesRootHintsÚ-BootstrapTests.test_resolverReceivesRootHintsŽ  sT   € ô
 $“~ˆÜŸ>š>¨,Ó7ÐØ×,Ô,ˆAØ�J‰J�}Ö%ñ -à×ÑÐ)×/Ñ/°-°À2Õ1EÖFr+   c                ó   a a€ \        4       p\        P                  ! V4      o\        VP                  4      p\        V4      pV F  pVP                  R4       K  	  VP                  \        4       4       VV 3R lpVP                  V4       R# )z§
The L{root.Resolver} is eventually created, even if some of the root
hint lookups fail. Only the working root hint IP addresses are supplied
to the L{root.Resolver}.
râ   c                 óP   <€ SP                  SP                  R .^,          4       R# )râ   N©r=   rÖ   ©Úresrø   rH   s   &€€r)   Ú
checkHintsÚFBootstrapTests.test_continuesWhenSomeRootHintsFail.<locals>.checkHints§  s!   ø€ Ø×ÑÐ-×3Ñ3°m°_ÀrÕ5IÖJr+   N)
rê   r
   rö   Úiterrî   Únextr  Úerrbackr   ÚaddBoth©rH   rý   r%   Úd1rK   r  rø   s   f     @r)   Ú#test_continuesWhenSomeRootHintsFailÚ2BootstrapTests.test_continuesWhenSomeRootHintsFail™  sl   ù€ ô $“~ˆÜŸ>š>¨,Ó7ÐÜ�|×2Ñ2Ó3ˆÜ�'‹]ˆÛˆAØ�J‰J�}Ö%ñ à
�
‰
”<“>Ô"ö	Kð 	�
‰
�:Ör+   c                óp  a a€ \        4       p\        P                  ! V4      o\        VP                  4      p\        V4      pV F  pVP                  \        4       4       K  	  VP                  \        4       4       VV 3R lpVP                  V4       S P                  S P                  \        4       R# )z”
The L{root.Resolver} is eventually created, even if all of the root hint
lookups fail. Pending and new lookups will then fail with
AttributeError.
c                 ó@   <€ SP                  SP                  . 4       R # ©Nr  r  s   &€€r)   r  ÚEBootstrapTests.test_continuesWhenAllRootHintsFail.<locals>.checkHintsº  s   ø€ Ø×ÑÐ-×3Ñ3°RÖ8r+   N)rê   r
   rö   r  rî   r  r  r   r  Ú
addCleanupÚflushLoggedErrorsr  s   f     @r)   Ú"test_continuesWhenAllRootHintsFailÚ1BootstrapTests.test_continuesWhenAllRootHintsFail¬  s�   ù€ ô $“~ˆÜŸ>š>¨,Ó7ÐÜ�|×2Ñ2Ó3ˆÜ�'‹]ˆÛˆAØ�I‰I”l“nÖ%ñ à
�
‰
”<“>Ô"ö	9ð 	�
‰
�:Ôà�‰˜×.Ñ.´Ö=r+   c                óÚ   € \        4       p\        P                  ! V\        R7      pVP                   F  pVP                  R4       K  	  V P                  VP                  \        4       R# )z›
L{root.bootstrap} accepts a C{resolverFactory} argument which is passed
as an argument to L{root.Resolver} when it has successfully looked up
root hints.
)r×   râ   N)rê   r
   rö   rÒ   rî   r  rØ   rÙ   r  s   &   r)   Útest_passesResolverFactoryÚ)BootstrapTests.test_passesResolverFactoryÁ  sV   € ô $“~ˆÜŸ>š>ØÔ*@ô
Ðð ×,Ô,ˆAØ�J‰J�}Ö%ñ -ð 	�‰Ð&×7Ñ7Ô9OÖPr+   rk   N)rÀ   rÁ   rÂ   rÃ   rÄ   rù   rÿ   r  r  r  r  r!  rÅ   rÆ   rÇ   s   @r)   rô   rô   l  s7   ø‡ € ñòGòQò
:ò	Gòò&>÷*Qð Qr+   rô   c                   ó*   a € ] tR tRt o RtR tRtV tR# )ÚStubDNSDatagramProtocoliÒ  z�
A do-nothing stand-in for L{DNSDatagramProtocol} which can be used to avoid
network traffic in tests where that kind of thing doesn't matter.
c                ó   € \        4       # r  )r   )rH   ÚaÚkws   &*,r)   rn   ÚStubDNSDatagramProtocol.queryØ  s
   € Ü‹zÐr+   rk   N)rÀ   rÁ   rÂ   rÃ   rÄ   rn   rÅ   rÆ   rÇ   s   @r)   r$  r$  Ò  s   ø‡ € ñ÷
ð r+   r$  zbtwisted.names.root.retry is deprecated since Twisted 10.0.  Use a Resolver object for retry logic.)ÚcategoryrP   N)za.root-servers.netzb.root-servers.netzc.root-servers.netzd.root-servers.netze.root-servers.netzf.root-servers.netzg.root-servers.netzh.root-servers.netzi.root-servers.netzj.root-servers.netzk.root-servers.netzl.root-servers.netzm.root-servers.net):rÄ   Úzope.interfacer   Úzope.interface.verifyr   Útwisted.internet.deferr   r   r   r   Útwisted.internet.interfacesr   Útwisted.namesr	   r
   Útwisted.names.dnsr   r   r   r   r   r   r   r   r   r   r   r   r   r   Útwisted.names.errorr   r   Útwisted.names.rootr   Útwisted.names.test.test_utilr   Útwisted.python.logr   Útwisted.trialr   Útwisted.trial.unittestr   r    r*   r/   r1   Ú	ExceptionrÊ   rÒ   rÔ   rü   rê   rô   r$  ÚsuppressÚDeprecationWarningÚ_retrySuppressionrk   r+   r)   Ú<module>r:     sä   ðñõ 'Ý -ç QÓ QÝ 7ß &÷÷ ÷ ÷ ÷  <Ý 'Ý 6Ý "Ý ß @òò/ôp0˜ô p0ôf˜yô ò"1ô'
 xô '
òT€ñ" ˆ_Ó÷!ð !ó ð!ñH ˆO˜\Ô *ôcQÐ(ô cQ÷Lñ ð —M’MØð	+ôÒ r+   