+
    üÐjå'  ã                   óº   € R t ^ RIHt ^ RIHt  ! R R4      t ! R R]]P                  4      t ! R R]]P                  4      t ! R	 R
]]P                  4      t	R# )z&
Tests for L{twisted.python.urlpath}.
)Úurlpath)Úunittestc                   ór   a € ] tR t^t o RtR tR t]3R ltR t	R t
R tR tR	 tR
 tR tR tR tRtV tR# )Ú_BaseURLPathTestsz-
Tests for instantiated L{urlpath.URLPath}s.
c                óª  € V P                  V P                  P                  \        4       V P                  V P                  P                  \        4       V P                  V P                  P                  \        4       V P                  V P                  P
                  \        4       V P                  V P                  P                  \        4       R# )zA
All of the attributes of L{urlpath.URLPath} should be L{bytes}.
N©ÚassertIsInstanceÚpathÚschemeÚbytesÚnetlocÚqueryÚfragment©Úselfs   &ÚB/usr/lib/python3/dist-packages/twisted/python/test/test_urlpath.pyÚtest_partsAreBytesÚ$_BaseURLPathTests.test_partsAreBytes   ó‚   € ð 	×Ñ˜dŸi™i×.Ñ.´Ô6Ø×Ñ˜dŸi™i×.Ñ.´Ô6Ø×Ñ˜dŸi™iŸn™n¬eÔ4Ø×Ñ˜dŸi™iŸo™o¬uÔ5Ø×Ñ˜dŸi™i×0Ñ0´%Ö8ó    c                ót   € V P                  \        V P                  P                  4       4      \        4       R# )zA
Calling C{str()} with a L{URLPath} will always return a L{str}.
N)ÚassertEqualÚtyper	   Ú__str__Ústrr   s   &r   Útest_strReturnsStrÚ$_BaseURLPathTests.test_strReturnsStr   s&   € ð 	×Ñœ˜dŸi™i×/Ñ/Ó1Ó2´CÖ8r   c                ó^  € V! R4      V P                   n        V P                  \        V P                   4      R4       V! R4      V P                   n        V P                  \        V P                   4      R4       V! R4      V P                   n         V P                  \        V P                   4      R4       V! R4      V P                   n        V P                  \        V P                   4      R4       V! R	4      V P                   n        V P                  \        V P                   4      R
4       R# )a  
Setting attributes on L{urlpath.URLPath} should change the value
returned by L{str}.

@param stringType: a callable to parameterize this test for different
    text types.
@type stringType: 1-argument callable taking L{str} and returning
    L{str} or L{bytes}.
Úhttpsz0https://example.com/foo/bar?yes=no&no=yes#footerzanother.example.invalidz<https://another.example.invalid/foo/bar?yes=no&no=yes#footerz/helloz:https://another.example.invalid/hello?yes=no&no=yes#footerzalpha=omega&opposites=samezGhttps://another.example.invalid/hello?alpha=omega&opposites=same#footerÚheaderzGhttps://another.example.invalid/hello?alpha=omega&opposites=same#headerN)r	   r
   r   r   r   r   r   )r   Ú
stringTypes   &&r   Útest_mutabilityWithTextÚ)_BaseURLPathTests.test_mutabilityWithText"   sñ   € ñ & gÓ.ˆ�	‰	ÔØ×ÑÜ�—	‘	‹NÐNô	
ñ &Ð&?Ó@ˆ�	‰	ÔØ×ÑÜ�—	‘	‹NØJô	
ñ $ HÓ-ˆ�	‰	ŒØ×ÑÜ�—	‘	‹NÐXô	
ñ %Ð%AÓBˆ�	‰	ŒØ×ÑÜ�—	‘	‹Nðô	
ñ
 (¨Ó1ˆ�	‰	ÔØ×ÑÜ�—	‘	‹Nðö	
r   c                ó*   € V P                  R 4       R# )z3
Same as L{test_mutabilityWithText} but for bytes.
c                 ó$   € V P                  R 4      # )Úascii)Úencode)Úxs   &r   Ú<lambda>Ú<_BaseURLPathTests.test_mutabilityWithBytes.<locals>.<lambda>J   s   € ¨q¯x©x¸Ô/@r   N)r!   r   s   &r   Útest_mutabilityWithBytesÚ*_BaseURLPathTests.test_mutabilityWithBytesF   s   € ð 	×$Ñ$Ñ%@ÖAr   c                óª  € V P                  V P                  P                  \        4       V P                  V P                  P                  \        4       V P                  V P                  P                  \        4       V P                  V P                  P
                  \        4       V P                  V P                  P                  \        4       R# )z,
A created L{URLPath} has bytes attributes.
Nr   r   s   &r   Útest_allAttributesAreBytesÚ,_BaseURLPathTests.test_allAttributesAreBytesL   r   r   c                óP   € V P                  \        V P                  4      R4       R# )z[
Calling C{str()} with a L{URLPath} will return the same URL that it was
constructed with.
ú/http://example.com/foo/bar?yes=no&no=yes#footerN)r   r   r	   r   s   &r   Útest_stringConversionÚ'_BaseURLPathTests.test_stringConversionV   s    € ð
 	×ÑÜ�—	‘	‹NÐMö	
r   c           	     ó`  € V P                  \        V P                  P                  R4      4      R4       V P                  \        V P                  P                  R4      P                  R4      4      R4       V P                  \        V P                  P                  RRR7      4      R4       R# )	zv
Calling C{str()} with a C{URLPath.child()} will return a URL which is
the child of the URL it was instantiated with.
s   helloz http://example.com/foo/bar/hellor   z!http://example.com/foo/bar/hello/T©Ú	keepQueryz.http://example.com/foo/bar/hello?yes=no&no=yesN)r   r   r	   Úchildr   s   &r   Útest_childStringÚ"_BaseURLPathTests.test_childString_   s‰   € ð
 	×ÑÜ�—	‘	—‘ Ó)Ó*Ð,Nô	
ð 	×ÑÜ�—	‘	—‘ Ó)×/Ñ/°Ó4Ó5Ø/ô	
ð 	×ÑÜ�—	‘	—‘ °D�Ó9Ó:Ø<ö	
r   c           	     ó`  € V P                  \        V P                  P                  R4      4      R4       V P                  \        V P                  P                  RRR7      4      R4       V P                  \        V P                  P	                  R4      P                  R4      4      R4       R# )	zz
Calling C{str()} with a C{URLPath.sibling()} will return a URL which is
the sibling of the URL it was instantiated with.
ó   bazzhttp://example.com/foo/bazTr4   z(http://example.com/foo/baz?yes=no&no=yesr   zhttp://example.com/foo/bar/bazN)r   r   r	   Úsiblingr6   r   s   &r   Útest_siblingStringÚ$_BaseURLPathTests.test_siblingStringp   s‰   € ð
 	×Ñœ˜TŸY™Y×.Ñ.¨vÓ6Ó7Ð9UÔVØ×ÑÜ�—	‘	×!Ñ! &°DÐ!Ó9Ó:Ø6ô	
ð 	×ÑÜ�—	‘	—‘ Ó$×,Ñ,¨VÓ4Ó5Ð7Wö	
r   c                ó´  € V P                  \        V P                  P                  4       4      R4       V P                  \        V P                  P                  RR7      4      R4       V P                  \        V P                  P	                  R4      P                  4       4      R4       V P                  \        V P                  P	                  R4      P                  4       4      R4       V P                  \        V P                  P                  4       P                  4       P                  4       P                  4       P                  4       4      R4       R# )	zx
Calling C{str()} with a C{URLPath.parent()} will return a URL which is
the parent of the URL it was instantiated with.
zhttp://example.com/Tr4   z!http://example.com/?yes=no&no=yesr   úhttp://example.com/foo/r:   N)r   r   r	   Úparentr6   r   s   &r   Útest_parentStringÚ#_BaseURLPathTests.test_parentStringƒ   sû   € ð 	×Ñœ˜TŸY™Y×-Ñ-Ó/Ó0Ð2GÔHØ×ÑÜ�—	‘	× Ñ ¨4Ð Ó0Ó1Ð3Vô	
ð 	×Ñœ˜TŸY™YŸ_™_¨SÓ1×8Ñ8Ó:Ó;Ð=VÔWØ×ÑÜ�—	‘	—‘ Ó'×.Ñ.Ó0Ó1Ð3Lô	
ð 	×ÑÜ�—	‘	× Ñ Ó"×)Ñ)Ó+×2Ñ2Ó4×;Ñ;Ó=×DÑDÓFÓGØ!ö	
r   c                óZ  € V P                  \        V P                  P                  4       4      R4       V P                  \        V P                  P                  RR7      4      R4       V P                  \        V P                  P	                  R4      P                  4       4      R4       R# )z“
Calling C{str()} with a C{URLPath.here()} will return a URL which is
the URL that it was instantiated with, without any file, query, or
fragment.
r?   Tr4   z%http://example.com/foo/?yes=no&no=yesr   zhttp://example.com/foo/bar/N)r   r   r	   Úherer6   r   s   &r   Útest_hereStringÚ!_BaseURLPathTests.test_hereString—   s~   € ð 	×Ñœ˜TŸY™YŸ^™^Ó-Ó.Ð0IÔJØ×ÑÜ�—	‘	—‘¨�Ó.Ó/Ð1Xô	
ð 	×ÑÜ�—	‘	—‘ Ó$×)Ñ)Ó+Ó,Ð.Kö	
r   c                óŒ   € V P                  \        V P                  P                  R4      4      P	                  R4      R4       R# )zÊ
Calling L{urlpath.URLPath.click} on a L{urlpath.URLPath} with a
trailing slash with a relative URL containing a leading slash will
result in a URL with a single slash at the start of the path portion.
s   /hello/worldr%   s   http://example.com/hello/worldN)r   r   r	   Úclickr&   r   s   &r   Útest_doubleSlashÚ"_BaseURLPathTests.test_doubleSlash¦   s5   € ð 	×ÑÜ�—	‘	—‘ Ó0Ó1×8Ñ8¸ÓAØ-ö	
r   c                óp  € V P                  V P                  P                  R4      P                  4       . RO4       V P                  V P                  P                  R4      P                  RR7      . RO4       V P                  V P                  P                  R4      P                  RR7      . RO4       R# )	z<
L{urlpath.URLPath.pathList} returns a L{list} of L{bytes}.
ó	   %00%01%02F)ÚcopyT)ÚunquoteN)r   ó   fooó   barrL   )r   rO   rP   s    )r   r	   r6   ÚpathListr   s   &r   Útest_pathListÚ_BaseURLPathTests.test_pathList±   s�   € ð 	×ÑØ�I‰I�O‰O˜LÓ)×2Ñ2Ó4Ú/ô	
ð 	×ÑØ�I‰I�O‰O˜LÓ)×2Ñ2¸Ð2Ó>Ú/ô	
ð 	×ÑØ�I‰I�O‰O˜LÓ)×2Ñ2¸4Ð2Ó@Ú2ö	
r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r!   r*   r-   r1   r7   r<   rA   rE   rI   rR   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      sR   ø‡ € ñò9ò9ð 25ô "
òHBò9ò
ò
ò"
ò&
ò(
ò	
÷
ð 
r   r   c                   óB   a € ] tR t^Èt o RtR tR tR tR tR t	Rt
V tR# )	ÚBytesURLPathTestszD
Tests for interacting with a L{URLPath} created with C{fromBytes}.
c                óN   € \         P                  P                  R 4      V n        R# )s/   http://example.com/foo/bar?yes=no&no=yes#footerN)r   ÚURLPathÚ	fromBytesr	   r   s   &r   ÚsetUpÚBytesURLPathTests.setUpÍ   s   € Ü—O‘O×-Ñ-Ø>ó
ˆŽ	r   c                óh  € V P                  \        4      ;_uu_ 4        \        P                  P	                  R4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  P	                  R4       RRR4       R#   + '       g   i     LW; i  + '       g   i     R# ; i)z5
L{URLPath.fromBytes} must take a L{bytes} argument.
NÚsomeurl)ÚassertRaisesÚ
ValueErrorr   ra   rb   r   s   &r   Útest_mustBeBytesÚ"BytesURLPathTests.test_mustBeBytesÒ   sn   € ð ×Ñœz×*Õ*Ü�O‰O×%Ñ% dÔ+÷ +ð ×Ñœz×*Õ*Ü�O‰O×%Ñ% iÔ0÷ +Ñ*÷ +×*ú÷ +×*Ð*úó   ž BÁ# B ÂB	Â B1	c                óf   € \         P                  ! 4       pV P                  \        V4      R4       R# )zX
An instantiation with no arguments creates a usable L{URLPath} with
default arguments.
zhttp://localhost/N)r   ra   r   r   ©r   Úurls   & r   Útest_withoutArgumentsÚ'BytesURLPathTests.test_withoutArgumentsÜ   s%   € ô
 �oŠoÓˆØ×Ñœ˜S›Ð#6Ö7r   c                ó’  € \         P                  P                  R4      pV P                  VP                  R4       V P                  VP
                  R4       V P                  VP                  R4       V P                  VP                  R4       V P                  VP                  R4       V P                  \        V4      R4       R# )zq
Leaving some optional arguments unfilled makes a L{URLPath} with those
optional arguments filled with defaults.
s   http://google.coms   https
   google.comó   /r   zhttp://google.com/N)
r   ra   rb   r   r
   r   r	   r   r   r   rm   s   & r   Útest_partialArgumentsÚ'BytesURLPathTests.test_partialArgumentsä   s’   € ô �o‰o×'Ñ'Ð(<Ó=ˆØ×Ñ˜Ÿ™ WÔ-Ø×Ñ˜Ÿ™ ]Ô3Ø×Ñ˜Ÿ™ 4Ô(Ø×Ñ˜Ÿ™ sÔ+Ø×Ñ˜Ÿ™ CÔ(Ø×Ñœ˜S›Ð#7Ö8r   c                óz   € \         P                  P                  R4      pV P                  \	        V4      R4       R# )zG
L{URLPath.fromBytes} can interpret non-ASCII bytes as percent-encoded
s   http://example.com/ÿ zhttp://example.com/%FF%00N)r   ra   rb   r   r   rm   s   & r   Útest_nonASCIIBytesÚ$BytesURLPathTests.test_nonASCIIBytesó   s.   € ô �o‰o×'Ñ'Ð(FÓGˆØ×Ñœ˜S›Ð#>Ö?r   ©r	   N)rU   rV   rW   rX   rY   rc   ri   ro   rs   rv   rZ   r[   r\   s   @r   r_   r_   È   s*   ø‡ € ñò
ò
1ò8ò9÷@ð @r   r_   c                   ó0   a € ] tR t^ût o RtR tR tRtV tR# )ÚStringURLPathTestsú[
Tests for interacting with a L{URLPath} created with C{fromString} and a
L{str} argument.
c                óN   € \         P                  P                  R 4      V n        R# ©r0   N©r   ra   Ú
fromStringr	   r   s   &r   rc   ÚStringURLPathTests.setUp  ó   € Ü—O‘O×.Ñ.Ø=ó
ˆŽ	r   c                óh  € V P                  \        4      ;_uu_ 4        \        P                  P	                  R4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  P	                  R4       RRR4       R#   + '       g   i     LW; i  + '       g   i     R# ; i)z>
C{URLPath.fromString} must take a L{str} or L{str} argument.
Ns   someurl)rg   rh   r   ra   r   r   s   &r   Útest_mustBeStrÚ!StringURLPathTests.test_mustBeStr  sn   € ð ×Ñœz×*Õ*Ü�O‰O×&Ñ& tÔ,÷ +ð ×Ñœz×*Õ*Ü�O‰O×&Ñ& zÔ2÷ +Ñ*÷ +×*ú÷ +×*Ð*úrk   rx   N)	rU   rV   rW   rX   rY   rc   rƒ   rZ   r[   r\   s   @r   rz   rz   û   s   ø‡ € ñò

÷
3ð 3r   rz   c                   ó0   a € ] tR tRt o RtR tR tRtV tR# )ÚUnicodeURLPathTestsi  r{   c                óN   € \         P                  P                  R 4      V n        R# r}   r~   r   s   &r   rc   ÚUnicodeURLPathTests.setUp  r�   r   c                óz   € \         P                  P                  R4      pV P                  \	        V4      R4       R# )z6
L{URLPath.fromString} can load non-ASCII characters.
u   http://example.com/Ã¿ zhttp://example.com/%C3%BF%00N)r   ra   r   r   r   rm   s   & r   Útest_nonASCIICharactersÚ+UnicodeURLPathTests.test_nonASCIICharacters  s.   € ô �o‰o×(Ñ(Ð)FÓGˆØ×Ñœ˜S›Ð#AÖBr   rx   N)	rU   rV   rW   rX   rY   rc   rŠ   rZ   r[   r\   s   @r   r†   r†     s   ø‡ € ñò

÷
Cð Cr   r†   N)
rY   Útwisted.pythonr   Útwisted.trialr   r   ÚTestCaser_   rz   r†   rT   r   r   Ú<module>r�      sc   ðñ
õ #Ý "÷x
ñ x
ôv0@Ð)¨8×+<Ñ+<ô 0@ôf3Ð*¨H×,=Ñ,=ô 3ô,CÐ+¨X×->Ñ->ö Cr   