Ë
    Gï÷_?Õ  ã                   óÊ   — d dl mZ d dlZd dlZd dlmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZmZ ej&                  d    dk(  Z ed	«      Zd
ZdZg d¢ZdZ G d„ de«      Zy)é    )Úunicode_literalsN)ÚAnyÚIterableÚOptionalÚTextÚTupleÚcasté   )ÚHyperlinkTestCaseé   )ÚURLÚURLParseError)Ú	inet_ptonÚSCHEME_PORT_MAPÚ ú*http://www.foo.com/a/nice/path/?zot=23&zutúhttp://a/b/c/d;p?q)()Úgúhttp://a/b/c/g)z./gr   )zg/úhttp://a/b/c/g/)z/gú
http://a/g)z//gzhttp://g)z?yzhttp://a/b/c/d;p?y)zg?yzhttp://a/b/c/g?y)z#szhttp://a/b/c/d;p?q#s)zg#szhttp://a/b/c/g#s)zg?y#szhttp://a/b/c/g?y#s)z;xzhttp://a/b/c/;x)zg;xzhttp://a/b/c/g;x)zg;x?y#szhttp://a/b/c/g;x?y#s)r   r   )ú.úhttp://a/b/c/)z./r   )ú..úhttp://a/b/)z../r   )z../gúhttp://a/b/g)z../..ú	http://a/)z../../r   )z../../gr   )z
../../../gr   )z../../../../gr   )z/./gr   )z/../gr   )zg.zhttp://a/b/c/g.)z.gzhttp://a/b/c/.g)zg..zhttp://a/b/c/g..)z..gzhttp://a/b/c/..g)z./../gr   )z./g/.r   )zg/./hzhttp://a/b/c/g/h)zg/../hzhttp://a/b/c/h)z	g;x=1/./yzhttp://a/b/c/g;x=1/y)z
g;x=1/../yzhttp://a/b/c/y)zg?y/./xzhttp://a/b/c/g?y/./x)zg?y/../xzhttp://a/b/c/g?y/../x)zg#s/./xzhttp://a/b/c/g#s/./x)zg#s/../xzhttp://a/b/c/g#s/../x)6zhttp://localhostúhttp://localhost/zhttp://127.0.0.1/zhttp://[::127.0.0.1]/zhttp://[::1]/zhttp://localhost/foozhttp://localhost/foo/zhttp://localhost/foo!!bar/zhttp://localhost/foo%20bar/zhttp://localhost/foo%2Fbar/zhttp://localhost/foo?nzhttp://localhost/foo?n=vzhttp://localhost/foo?n=/a/bz%http://example.com/foo!@$bar?b!@z=123z$http://localhost/asd?a=asd%20sdf/345z6http://(%2525)/(%2525)?(%2525)&(%2525)=(%2525)#(%2525)z<http://(%C3%A9)/(%C3%A9)?(%C3%A9)&(%C3%A9)=(%C3%A9)#(%C3%A9)zG?sslrootcert=/Users/glyph/Downloads/rds-ca-2015-root.pem&sslmode=verifyz%http://googlewebsite.com/e-shops.aspxz?http://example.com:8080/search?q=123&business=Nothing%20Specialz*http://hatnote.com:9000/?arg=1&arg=2&arg=3úhttps://xn--bcher-kva.chz"http://xn--ggbla1c4e.xn--ngbc5azd/z.http://tools.ietf.org/html/rfc3986#section-3.4z:ftp://ftp.rfc-editor.org/in-notes/tar/RFCs0001-0500.tar.gzz.http://[1080:0:0:0:8:800:200C:417A]/index.htmlzssh://192.0.2.16:2222/z$https://[::101.45.75.219]:80/?hi=byez7ldap://[::192.9.5.5]/dc=example,dc=com??sub?(sn=Jensen)zFmailto:me@example.com?to=me@example.com&body=hi%20http://wikipedia.orgznews:alt.rec.motorcycleztel:+1-800-867-5309zurn:oasis:member:A00024:xa  magnet:?xt=urn:btih:1a42b9e04e122b97a5254e3df77ab3c4b7da725f&dn=Puppy%20Linux%20precise-5.7.1.iso&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.publicbt.com:80&tr=udp://tracker.istole.it:6969&tr=udp://tracker.ccc.de:80&tr=udp://open.demonii.com:1337zhttps://%3A@example.com/zhttps://%40@example.com/zhttps://%2f@example.com/zhttps://a:%3a@example.com/zhttps://a:%40@example.com/zhttps://a:%2f@example.com/zhttps://a:%3f@example.com/zhttps://example.com/%2F/zhttps://example.com/%3F/zhttps://example.com/%23/zhttps://example.com/?%23=bzhttps://example.com/?%3D=bzhttps://example.com/?%26=bzhttps://example.com/?a=%23zhttps://example.com/?a=%26zhttps://example.com/?a=%3Dz https://example.com/?foo+bar=bazz https://example.com/?foo=bar+bazzChttp://(%2525):(%2525)@example.com/(%2525)/?(%2525)=(%2525)#(%2525)z8first_seg_rel_path__colon%3Anotok/second_seg__colon%3Aokc                   óÖ  — e Zd ZdZd„ Z	 dNd„Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d „ Z"d!„ Z#d"„ Z$d#„ Z%d$„ Z&d%„ Z'd&„ Z(d'„ Z)d(„ Z*d)„ Z+d*„ Z,d+„ Z-d,„ Z.d-„ Z/d.„ Z0d/„ Z1d0„ Z2d1„ Z3d2„ Z4d3„ Z5d4„ Z6d5„ Z7d6„ Z8d7„ Z9d8„ Z:d9„ Z;d:„ Z<d;„ Z=d<„ Z>d=„ Z?d>„ Z@d?„ ZAd@„ ZBdA„ ZCdB„ ZDdC„ ZEdD„ ZFdE„ ZGdF„ ZHdG„ ZIdH„ ZJdI„ ZKdJ„ ZLdK„ ZMdL„ ZNyM)OÚTestURLz
    Tests for L{URL}.
    c                 óÂ  — | j                  t        |j                  t        «      xs |j                  du t	        |«      «       | j                  t        |j
                  t        «      xs |j
                  du t	        |«      «       |j                  D ]+  }| j                  t        |«      t        t	        |«      «       Œ- |j                  D ]]  \  }}| j                  t        «      t        t	        |«      «       | j                  |du xs t        |t        «      t	        |«      «       Œ_ | j                  t        |j                  «      t        t	        |«      «       y)zl
        The given L{URL}'s components should be L{unicode}.

        @param u: The L{URL} to test.
        N)Ú
assertTrueÚ
isinstanceÚschemeÚunicodeÚreprÚhostÚpathÚassertEqualÚtypeÚqueryÚfragment)ÚselfÚuÚsegÚ_kÚvs        ú9/usr/lib/python3/dist-packages/hyperlink/test/test_url.pyÚassertUnicodedzTestURL.assertUnicoded–   s  € ð 	�‰Ü�q—x‘x¤Ó)Ò=¨Q¯X©X¸Ð-=¼tÀA»wô	
ð 	�‰œ
 1§6¡6¬7Ó3ÒE°q·v±vÀ°~ÄtÈAÃwÔOØ—6‘6ò 	:ˆCØ×ÑœT #›Y¬´°a³Õ9ð	:à—w‘wò 	J‰GˆR�Ø×ÑœT #›Y¬´°a³Ô9Ø�O‰O˜A ˜IÒ?¬°A´wÓ)?ÄÀaÃÕIð	Jð 	×Ñœ˜aŸj™jÓ)¬7´D¸³GÕ<ó    c	                 ó  — |j                   |j                  |j                  |j                  |j                  |j
                  |j                  f}	||t        |«      t        |«      |||j                  f}
| j                  |	|
«       y)aª  
        The given L{URL} should have the given components.

        @param u: The actual L{URL} to examine.

        @param scheme: The expected scheme.

        @param host: The expected host.

        @param path: The expected path.

        @param query: The expected query.

        @param fragment: The expected fragment.

        @param port: The expected port.

        @param userinfo: The expected userinfo.
        N)	r%   r(   r)   r,   r-   ÚportÚuserinfoÚtupler*   )r.   r/   r%   r(   r)   r,   r-   r7   r8   ÚactualÚexpecteds              r3   Ú	assertURLzTestURL.assertURL¨   sy   € ð@ �H‰HØ�F‰FØ�F‰FØ�G‰GØ�J‰JØ�F‰FØ�J‰Jð
ˆð ØÜ�$‹KÜ�%‹LØØØ�J‰Jð
ˆð 	×Ñ˜ Õ*r5   c           	      ó†   ‡ — ˆ fd„} |t        dd«      «        |t        ddg g «      «        |t        ddg g d«      «       y)z@
        L{URL} should have appropriate default values.
        c           
      óX   •— ‰j                  | «       ‰j                  | ddg g ddd«       y )NÚhttpr   éP   )r4   r<   )r/   r.   s    €r3   Úcheckz(TestURL.test_initDefaults.<locals>.checká   s+   ø€ à×Ñ Ô"Ø�N‰N˜1˜f b¨"¨b°"°b¸"Õ=r5   r?   r   N)r   )r.   rA   s   ` r3   Útest_initDefaultszTestURL.test_initDefaultsÛ   s@   ø€ ô	>ñ
 	Œc�&˜"‹oÔÙŒc�&˜"˜b "Ó%Ô&ÙŒc�&˜"˜b " bÓ)Õ*r5   c           	      óÎ   — t        dddgddgd«      }| j                  |«       | j                  |dddgddgdd«       | j                  t        dd	d
gdgd«      dd	d
gdgdd«       y)z=
        L{URL} should accept L{unicode} parameters.
        ÚsÚhÚp©Úkr2   )rH   NÚfNr?   õ   Ã õ   Ã©)u   Î»u   Ï€u   âŠ¥r@   ©r   r4   r<   ©r.   r/   s     r3   Ú	test_initzTestURL.test_initê   sƒ   € ô
 ��S˜3˜% *¨kÐ!:¸CÓ@ˆØ×Ñ˜AÔØ�‰�q˜#˜s S E¨J¸Ð+DÀcÈ4ÔPà�‰Ü�˜  Ð+?Ð*@À(ÓKØØØˆHØ!Ð"ØØõ	
r5   c           	      ó~   — t        dddgddgd«      }| j                  |«       | j                  |dddgddgdd«       y)zN
        L{URL} should accept (and not interpret) percent characters.
        rD   z%68z%70)ú%6Bz%76)rP   Nz%66NrL   rM   s     r3   Útest_initPercentzTestURL.test_initPercentý   sM   € ô
 ��U˜U˜G n°mÐ%DÀeÓLˆØ×Ñ˜AÔØ�‰Øˆs�E˜E˜7 ^°]Ð$CÀUÈDõ	
r5   c                 óv   — | j                  t        t        dddgddgd¬«      «      dt        d	«      ›d
�«       y)zº
        L{URL.__repr__} will display the canonical form of the URL, wrapped in
        a L{URL.from_text} invocation, so that it is C{eval}-able but still
        easy to read.
        r?   ÚfooÚbar)ÚbazNrG   Úfrob©r%   r(   r)   r,   r-   zURL.from_text(zhttp://foo/bar?baz&k=v#frobú)N)r*   r'   r   ©r.   s    r3   Ú	test_reprzTestURL.test_repr  sF   € ð 	×ÑÜÜØ!ØØ˜Ø(¨*Ð5Ø#ôôô $(Ð(EÕ#FÐHõ	
r5   c                 ó~   — t        j                  t        «      }| j                  t        |j	                  «       «       y)zc
        Round-tripping L{URL.from_text} with C{str} results in an equivalent
        URL.
        N)r   Ú	from_textÚ	BASIC_URLr*   Úto_text©r.   Úurlpaths     r3   Útest_from_textzTestURL.test_from_text  s)   € ô —-‘-¤	Ó*ˆØ×Ñœ G§O¡OÓ$5Õ6r5   c                 óˆ   — t         D ]9  }t        j                  |«      j                  d¬«      }| j	                  ||«       Œ; y)z@
        L{URL.to_text} should invert L{URL.from_text}.
        T©Úwith_passwordN)ÚROUNDTRIP_TESTSr   r\   r^   r*   )r.   ÚtestÚresults      r3   Útest_roundtripzTestURL.test_roundtrip%  s?   € ô
 $ò 	+ˆDÜ—]‘] 4Ó(×0Ñ0¸tÐ0ÓDˆFØ×Ñ˜T 6Õ*ñ	+r5   c                 óè   — t         D ]i  }t        j                  |«      }|j                  «       }|j                  «       }||k(  sJ ‚|j	                  d¬«      }|j	                  d¬«      }||k(  rŒiJ ‚ y )NTrc   )re   r   r\   Úto_irir^   )r.   rf   ÚurlÚiriÚ
double_iriÚiri_textÚdouble_iri_texts          r3   Útest_roundtrip_double_iriz!TestURL.test_roundtrip_double_iri.  sy   € ä#ò 	/ˆDÜ—-‘- Ó%ˆCØ—*‘*“,ˆCØŸ™›ˆJØ˜*Ò$Ð$Ð$à—{‘{°�{Ó6ˆHØ(×0Ñ0¸tÐ0ÓDˆOØ˜Ó.Ð.Ð.ð	/ð 	r5   c                 óÒ   — t        j                  t        «      }| j                  |t        j                  t        «      «       | j	                  |t        j                  d«      «       y)z·
        Two URLs decoded using L{URL.from_text} will be equal (C{==}) if they
        decoded same URL string, and unequal (C{!=}) if they decoded different
        strings.
        z:ftp://www.anotherinvaliddomain.com/foo/bar/baz/?zot=21&zutN)r   r\   r]   r*   ÚassertNotEqualr_   s     r3   Útest_equalityzTestURL.test_equality;  sK   € ô —-‘-¤	Ó*ˆØ×Ñ˜¤#§-¡-´	Ó":Ô;Ø×ÑØÜ�M‰MØOóõ	
r5   c                 ó¼   — | j                  t        d¬«      t        «       «       | j                  t        j                  d«      t        j                  d«      «       y)zŒ
        An URL created with the empty string for a fragment compares equal
        to an URL created with an unspecified fragment.
        r   )r-   zhttp://localhost/#r   N)r*   r   r\   rY   s    r3   Útest_fragmentEqualityzTestURL.test_fragmentEqualityK  sC   € ð 	×Ñœ bÔ)¬3«5Ô1Ø×ÑÜ�M‰MÐ.Ó/Ü�M‰MÐ-Ó.õ	
r5   c                 ó®  — t        j                  t        «      }| j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       y	)
zm
        L{URL.child} appends a new path segment, but does not affect the query
        or fragment.
        z.http://www.foo.com/a/nice/path/gong?zot=23&zutÚgongz1http://www.foo.com/a/nice/path/gong%2F?zot=23&zutzgong/z7http://www.foo.com/a/nice/path/gong%2Fdouble?zot=23&zutzgong/doublez:http://www.foo.com/a/nice/path/gong%2Fdouble%2F?zot=23&zutzgong/double/N)r   r\   r]   r*   Úchildr^   r_   s     r3   Ú
test_childzTestURL.test_childW  s°   € ô —-‘-¤	Ó*ˆØ×ÑØ<Ø�M‰M˜&Ó!×)Ñ)Ó+ô	
ð 	×ÑØ?Ø�M‰M˜'Ó"×*Ñ*Ó,ô	
ð 	×ÑØEØ�M‰M˜-Ó(×0Ñ0Ó2ô	
ð 	×ÑØHØ�M‰M˜.Ó)×1Ñ1Ó3õ	
r5   c                 ó�   — t        j                  d«      }| j                  |j                  ddd«      j	                  «       d«       y)zg
        L{URL.child} receives multiple segments as C{*args} and appends each in
        turn.
        zhttp://example.com/a/bÚcÚdÚezhttp://example.com/a/b/c/d/eN)r   r\   r*   rx   r^   ©r.   rk   s     r3   Útest_multiChildzTestURL.test_multiChildo  s=   € ô �m‰mÐ4Ó5ˆØ×ÑØ�I‰I�c˜3 Ó$×,Ñ,Ó.Ð0Nõ	
r5   c                 ó°   — t        d¬«      j                  d«      }| j                  |j                  «       | j	                  d|j                  «       «       y)zo
        L{URL.child} of a L{URL} without a path produces a L{URL} with a single
        path segment.
        úwww.foo.com©r(   r{   zhttp://www.foo.com/cN)r   rx   r#   Úrootedr*   r^   )r.   ÚchildURLs     r3   Útest_childInitRootzTestURL.test_childInitRootz  sC   € ô ˜MÔ*×0Ñ0°Ó5ˆØ�‰˜Ÿ™Ô(Ø×ÑÐ/°×1AÑ1AÓ1CÕDr5   c                 ó\   — t        d¬«      }| j                  |j                  «       |«       y)zT
        L{URL.child} without any new segments returns the original L{URL}.
        r�   r‚   N)r   r*   rx   r~   s     r3   Útest_emptyChildzTestURL.test_emptyChild„  s$   € ô
 �}Ô%ˆØ×Ñ˜Ÿ™› cÕ*r5   c                 ó   — t        j                  t        «      }| j                  d|j	                  d«      j                  «       «       d}t        j                  |«      }| j                  d|j	                  d«      j                  «       «       y)z
        L{URL.sibling} of a L{URL} replaces the last path segment, but does not
        affect the query or fragment.
        z0http://www.foo.com/a/nice/path/sister?zot=23&zutÚsisterz)http://www.foo.com/a/nice/path?zot=23&zutz+http://www.foo.com/a/nice/sister?zot=23&zutN)r   r\   r]   r*   Úsiblingr^   )r.   r`   Úurl_texts      r3   Útest_siblingzTestURL.test_siblingŒ  ss   € ô —-‘-¤	Ó*ˆØ×ÑØ>Ø�O‰O˜HÓ%×-Ñ-Ó/ô	
ð
 ?ˆÜ—-‘- Ó)ˆØ×ÑØ9Ø�O‰O˜HÓ%×-Ñ-Ó/õ	
r5   c                 ó¼  — t        j                  t        «      }| j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       | j                  d|j	                  d«      j                  «       «       | j                  d	|j	                  d
«      j                  «       v«       t        j                  d«      }| j                  d|j	                  d«      j                  «       «       t        j                  d«      }| j                  |j	                  d«      j                  «       d«       t        j                  d«      }d}| j                  |j	                  d«      j                  «       |«       | j                  |j	                  «       j                  «       |«       t        j                  d«      }t        j                  d«      }|j	                  |«      }| j                  |j                  «       d«       y)z¦
        L{URL.click} interprets the given string as a relative URI-reference
        and returns a new L{URL} interpreting C{self} as the base absolute URI.
        r   r   z$http://www.foo.com/a/nice/path/clickÚclickzhttp://www.foo.com/clickz/clickz$http://www.foo.com/a/nice/path/?burpz?burpz//foobarzhttp://www.foo.com/foobarzhttp://www.foo.com/me/noqueryz!http://www.foo.com/me/17?spam=158z/me/17?spam=158zhttp://localhost/foo?abc=defzhttp://www.python.orgz$http://hatnote.com/a/b/../c/./d/e/..zhttp://hatnote.com/a/c/d/zhttp://localhost/foo/?abc=defrT   zhttp://localhost/foo/barN)r   r\   r]   r*   rŽ   r^   r#   ÚfromText)r.   r`   r/   ÚresÚu2Úu3s         r3   Ú
test_clickzTestURL.test_clickŸ  sç  € ô —-‘-¤	Ó*ˆà×ÑØ8Ø�M‰M˜"Ó×%Ñ%Ó'ô	
ð
 	×ÑØ2Ø�M‰M˜'Ó"×*Ñ*Ó,ô	
ð
 	×ÑØ&¨¯©°hÓ(?×(GÑ(GÓ(Iô	
ð 	×ÑØ2Ø�M‰M˜'Ó"×*Ñ*Ó,ô	
ð 	�‰ØØ—=‘=Ð!<Ó=×EÑEÓGðHô	
ô �M‰MÐ9Ó:ˆØ×ÑØ/Ø�G‰GÐ%Ó&×.Ñ.Ó0ô	
ô �M‰MÐ8Ó9ˆØ×ÑØ�G‰GÐ+Ó,×4Ñ4Ó6Ð8Oô	
ô
 �M‰MÐ@ÓAˆØ)ˆØ×Ñ˜Ÿ™ ›×,Ñ,Ó.°Ô4ð 	×Ñ˜Ÿ™›×*Ñ*Ó,¨cÔ2ô �L‰LÐ8Ó9ˆÜ�]‰]˜5Ó!ˆØ�W‰W�R‹[ˆØ×Ñ˜Ÿ™›Ð'AÕBr5   c                 ó°   — t        j                  t        «      }t        D ]4  \  }}| j	                  |j                  |«      j                  «       |«       Œ6 y)zQ
        L{URL.click} should correctly resolve the examples in RFC 3986.
        N)r   r\   ÚrelativeLinkBaseForRFC3986ÚrelativeLinkTestsForRFC3986r*   rŽ   r^   )r.   ÚbaseÚrefr;   s       r3   Útest_clickRFC3986zTestURL.test_clickRFC3986Ý  sI   € ô
 �}‰}Ô7Ó8ˆÜ:ò 	B‰OˆS�(Ø×Ñ˜TŸZ™Z¨›_×4Ñ4Ó6¸ÕAñ	Br5   c                 óº   — t        j                  t        «      }| j                  t        |j
                  d«       | j                  t        |j
                  d«       y)zM
        L{URL.click} should not accept schemes with relative paths.
        zg:hzhttp:hN)r   r\   r•   ÚassertRaisesÚNotImplementedErrorrŽ   )r.   r—   s     r3   Útest_clickSchemeRelPathzTestURL.test_clickSchemeRelPathæ  sA   € ô
 �}‰}Ô7Ó8ˆØ×ÑÔ-¨t¯z©z¸5ÔAØ×ÑÔ-¨t¯z©z¸8ÕDr5   c           
      ó2  — t        j                  d«      }| j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                  «      |«       | j                  |j                  «       |«       y)zf
        Verify that L{URL.replace} doesn't change any of the arguments it
        is passed.
        zhttps://x:1/y?z=1#AN)
r   r\   r*   Úreplacer%   r(   r)   r,   r-   r7   r_   s     r3   Útest_cloneUnchangedzTestURL.test_cloneUnchangedï  sw   € ô —-‘-Ð 5Ó6ˆØ×ÑØ�O‰OØ—‘Ø—‘Ø—‘Ø—‘Ø× Ñ Ø—‘óð ô
	
ð 	×Ñ˜Ÿ™Ó*¨GÕ4r5   c                 ó.  — g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d¢g d	¢g d
¢g d¢g d¢g d¢g}|D ]g  \  }}}t        j                  |«      j                  |«      j                  «       }| j	                  ||dj                  |t        |«      ||¬«      «       Œi y)zd
        L{URL.click} collapses C{.} and C{..} according to RFC 3986 section
        5.2.4.
        )r   r   r   )r   r   r   )úhttp://localhost/a/b/cr   zhttp://localhost/a/b/)r¢   r   zhttp://localhost/a/)r¢   z./d/ezhttp://localhost/a/b/d/e)r¢   ú../d/eúhttp://localhost/a/d/e)r¢   z/./d/eúhttp://localhost/d/e)r¢   z/../d/er¥   )zhttp://localhost/a/b/c/z
../../d/e/zhttp://localhost/a/d/e/)zhttp://localhost/a/./cr£   r¥   )zhttp://localhost/a/./c/r£   r¤   )zhttp://localhost/a/b/c/dz./e/../f/../gzhttp://localhost/a/b/c/g)r¢   zd//ezhttp://localhost/a/b/d//ez1{start}.click({click}) => {actual} not {expected})ÚstartrŽ   r:   r;   N)r   r\   rŽ   r^   r*   Úformatr'   )r.   Útestsr¦   rŽ   r;   r:   s         r3   Útest_clickCollapsezTestURL.test_clickCollapse  s®   € ò <Ú<ÚDÚCÚKÚJÚHÚIòò
 IÚKòò
 Lð+
ˆð. ',ò 	Ñ"ˆE�5˜(Ü—]‘] 5Ó)×/Ñ/°Ó6×>Ñ>Ó@ˆFØ×ÑØØØC×JÑJØÜ˜u›+Ø!Ø%ð	 Kó õ	ñ	r5   c                 ój  — | j                  dt        j                  d«      j                  dd«      j	                  «       «       | j                  dt        d¬«      j                  dd«      j	                  «       «       t        j                  t
        «      }| j                  d|j                  d	«      j	                  «       «       | j                  d
|j                  d	d«      j	                  «       «       | j                  d|j                  d	d«      j                  d«      j	                  «       «       | j                  d|j                  d«      j                  d	d«      j	                  «       «       | j                  d|j                  d	d«      j                  dd«      j	                  «       «       y)z3
        L{URL.add} adds query parameters.
        z'http://www.foo.com/a/nice/path/?foo=barzhttp://www.foo.com/a/nice/path/rS   rT   zhttp://www.foo.com/?foo=barr�   r‚   z/http://www.foo.com/a/nice/path/?zot=23&zut&burpÚburpz3http://www.foo.com/a/nice/path/?zot=23&zut&burp=xxxÚxxxz8http://www.foo.com/a/nice/path/?zot=23&zut&burp=xxx&zingÚzingz8http://www.foo.com/a/nice/path/?zot=23&zut&zing&burp=xxxz:http://www.foo.com/a/nice/path/?zot=23&zut&burp=xxx&zot=32ÚzotÚ32N)r*   r   r\   Úaddr^   r]   r_   s     r3   Útest_queryAddzTestURL.test_queryAdd-  sg  € ð
 	×ÑØ5Ü�M‰MÐ;Ó<ß‰S�˜Óß‰W‹Yô		
ð 	×ÑØ)Ü�]Ô#×'Ñ'¨¨uÓ5×=Ñ=Ó?ô	
ô —-‘-¤	Ó*ˆØ×ÑØ=Ø�K‰K˜Ó×'Ñ'Ó)ô	
ð 	×ÑØAØ�K‰K˜ Ó&×.Ñ.Ó0ô	
ð 	×ÑØFØ�K‰K˜ Ó&×*Ñ*¨6Ó2×:Ñ:Ó<ô	
ð
 	×ÑØFØ�K‰K˜Ó×#Ñ# F¨EÓ2×:Ñ:Ó<ô	
ð
 	×ÑØHØ�K‰K˜ Ó&×*Ñ*¨5°$Ó7×?Ñ?ÓAõ	
r5   c                 ó”  — t        j                  t        «      }| j                  d|j	                  dd«      j                  «       «       | j                  d|j	                  d«      j	                  dd«      j                  «       «       | j                  d|j                  dd«      j	                  dd«      j                  «       «       y)	z?
        L{URL.set} replaces query parameters by name.
        z*http://www.foo.com/a/nice/path/?zot=32&zutr®   r¯   z0http://www.foo.com/a/nice/path/?zot&zut=itworkedÚzutÚitworkedr¬   N)r   r\   r]   r*   Úsetr^   r°   r_   s     r3   Útest_querySetzTestURL.test_querySetT  s¦   € ô
 —-‘-¤	Ó*ˆØ×ÑØ8Ø�K‰K˜˜tÓ$×,Ñ,Ó.ô	
ð
 	×ÑØ>Ø�K‰K˜Ó×"Ñ" 5¨*Ó5×=Ñ=Ó?ô	
ð 	×ÑØ8Ø�K‰K˜˜uÓ%×)Ñ)¨%°Ó6×>Ñ>Ó@õ	
r5   c                 óÜ  — t        j                  d«      }| j                  |j                  d«      t        j                  d«      «       | j                  |j                  dd¬«      t        j                  d«      «       | j                  |j                  dd¬«      t        j                  d«      «       | j                  |j                  ddd	¬
«      t        j                  d«      «       y)zG
        L{URL.remove} removes instances of a query parameter.
        z*https://example.com/a/b/?foo=1&bar=2&foo=3rS   zhttps://example.com/a/b/?bar=2Ú1)ÚnameÚvaluez$https://example.com/a/b/?bar=2&foo=3r
   )r¹   Úlimitr   )r¹   rº   r»   N)r   r\   r*   Úremover~   s     r3   Útest_queryRemovezTestURL.test_queryRemovej  sÂ   € ô
 �m‰mÐHÓIˆØ×ÑØ�J‰J�uÓœsŸ}™}Ð-MÓNô	
ð 	×ÑØ�J‰J˜E¨ˆJÓ-Ü�M‰MÐ@ÓAô	
ð
 	×ÑØ�J‰J˜E¨ˆJÓ+Ü�M‰MÐ@ÓAô	
ð
 	×ÑØ�J‰J˜E¨°AˆJÓ6Ü�M‰MÐFÓGõ	
r5   c                 óB  — t        j                  d«      }| j                  |j                  d«      dg«       | j                  |j	                  «       d«       t        j                  d«      }| j                  |j
                  d«       | j                  |j	                  «       d«       t        j                  d«      }|j                  «       }| j                  |j                  d«      dg«       | j                  |j                  «       j                  d«      dg«       y	)
z€
        Every C{=}-sign after the first in a query parameter is simply included
        in the value of the parameter.
        zhttp://localhost/?=x=x=xr   úx=x=xz!http://localhost/?foo=x=x=x&bar=y))rS   r¿   )rT   Úyz7https://example.com/?argument=3&argument=4&operator=%3DÚoperatorú=N)r   r\   r*   Úgetr^   r,   rj   Úto_uri)r.   r/   rl   s      r3   Útest_parseEqualSignInParamValuez'TestURL.test_parseEqualSignInParamValueƒ  sÛ   € ô �M‰MÐ4Ó5ˆØ×Ñ˜Ÿ™˜r› W IÔ.Ø×Ñ˜Ÿ™›Ð&@ÔAÜ�M‰MÐ=Ó>ˆØ×Ñ˜Ÿ™Ð"BÔCØ×Ñ˜Ÿ™›Ð&IÔJä�M‰MØEó
ˆð �h‰h‹jˆØ×Ñ˜Ÿ™ Ó,¨s¨eÔ4à×Ñ˜Ÿ™›×)Ñ)¨*Ó5¸°uÕ=r5   c                 óT   — | j                  t        «       j                  «       d«       y)zG
        An empty L{URL} should serialize as the empty string.
        r   N)r*   r   r^   rY   s    r3   Ú
test_emptyzTestURL.test_empty˜  s   € ð
 	×Ñœ›Ÿ™›¨"Õ-r5   c                 ó^   — t        dg¬«      }| j                  |j                  «       d«       y)zP
        An L{URL} with query text should serialize as just query text.
        ©ÚhelloÚworld©r,   z?hello=worldN)r   r*   r^   rM   s     r3   Útest_justQueryTextzTestURL.test_justQueryTextŸ  s(   € ô
 Ð)Ð*Ô+ˆØ×Ñ˜Ÿ™› nÕ5r5   c                 óR   — t        j                  d«      }| j                  ||«       y)z2
        L{URL} compares equal to itself.
        r   N©r   r\   r*   rM   s     r3   Útest_identicalEqualzTestURL.test_identicalEqual§  s#   € ô
 �M‰MÐ-Ó.ˆØ×Ñ˜˜AÕr5   c                 ó|   — t        j                  d«      }t        j                  d«      }| j                  ||«       y)zG
        URLs with equivalent components should compare equal.
        ú%http://u@localhost:8080/p/a/t/h?q=p#fNrÏ   ©r.   Úu1r‘   s      r3   Útest_similarEqualzTestURL.test_similarEqual¯  s2   € ô
 �]‰]ÐBÓCˆÜ�]‰]ÐBÓCˆØ×Ñ˜˜RÕ r5   c                 ó°   — t        j                  d«      }t        j                  d«      }| j                  ||k(  |›d|›�«       | j                  ||«       y)z|
        L{URL}s that refer to different resources are both unequal (C{!=}) and
        also not equal (not C{==}).
        úhttp://localhost/aúhttp://localhost/bú != N)r   r\   ÚassertFalserr   rÓ   s      r3   Útest_differentNotEqualzTestURL.test_differentNotEqual¸  sK   € ô �]‰]Ð/Ó0ˆÜ�]‰]Ð/Ó0ˆØ×Ñ˜˜r™²±RÐ#8Ô9Ø×Ñ˜B Õ#r5   c                 óê   — t        j                  d«      }| j                  |dk(  d«       | j                  |t        «       k(  d«       | j	                  |d«       | j	                  |t        «       «       y)z=
        L{URL} is not equal (C{==}) to other types.
        r   é*   zURL must not equal a number.zURL must not equal an object.N)r   r\   rÚ   Úobjectrr   rM   s     r3   Útest_otherTypesNotEqualzTestURL.test_otherTypesNotEqualÃ  sa   € ô
 �M‰MÐ-Ó.ˆØ×Ñ˜˜b™Ð"@ÔAØ×Ñ˜œf›h™Ð(GÔHØ×Ñ˜A˜rÔ"Ø×Ñ˜Aœv›xÕ(r5   c                 ó^   — t        j                  d«      }| j                  ||k7  d|z  «       y)zJ
        Identical L{URL}s are not unequal (C{!=}) to each other.
        rÒ   z%r == itselfN©r   r\   rÚ   rM   s     r3   Útest_identicalNotUnequalz TestURL.test_identicalNotUnequalÎ  s,   € ô
 �M‰MÐAÓBˆØ×Ñ˜˜a™ °!Ñ!3Õ4r5   c                 óŒ   — t        j                  d«      }t        j                  d«      }| j                  ||k7  |›d|›�«       y)zU
        Structurally similar L{URL}s are not unequal (C{!=}) to each other.
        rÒ   ú == Nrá   rÓ   s      r3   Útest_similarNotUnequalzTestURL.test_similarNotUnequalÖ  s;   € ô
 �]‰]ÐBÓCˆÜ�]‰]ÐBÓCˆØ×Ñ˜˜r™²±RÐ#8Õ9r5   c                 óŒ   — t        j                  d«      }t        j                  d«      }| j                  ||k7  |›d|›�«       y)zS
        Structurally different L{URL}s are unequal (C{!=}) to each other.
        r×   rØ   rä   N)r   r\   r#   rÓ   s      r3   Útest_differentUnequalzTestURL.test_differentUnequalß  s9   € ô
 �]‰]Ð/Ó0ˆÜ�]‰]Ð/Ó0ˆØ�‰˜˜b™²±BÐ"7Õ8r5   c                 ó’   — t        j                  d«      }| j                  |dk7  d«       | j                  |t        «       k7  d«       y)z;
        L{URL} is unequal (C{!=}) to other types.
        r   rÝ   zURL must differ from a number.z"URL must be differ from an object.N)r   r\   r#   rÞ   rM   s     r3   Útest_otherTypesUnequalzTestURL.test_otherTypesUnequalè  s;   € ô
 �M‰MÐ-Ó.ˆØ�‰˜˜R™Ð!AÔBØ�‰˜œV›X™Ð'KÕLr5   c                 ó\  — d}t        j                  |«      }|j                  «       }| j                  |j                  d«       | j                  |j
                  d   d«       | j                  |j                  «       |«       d}|j                  «       }| j                  |||›d|›�«       y)z‹
        L{URL.asURI} produces an URI which converts any URI unicode encoding
        into pure US-ASCII and returns a new L{URL}.
        õ   http://Ã©.com/eÌ�?aÌ�=iÌ�#uÌ�u   Ã©.comr   u   eÌ�ú.http://xn--9ca.com/%C3%A9?%C3%A1=%C3%AD#%C3%BArÙ   N)r   r\   ÚasURIr*   r(   r)   r^   )r.   Úunicodeyrl   ÚuriÚexpectedURIÚ	actualURIs         r3   Ú
test_asURIzTestURL.test_asURIñ  s›   € ðBð 	ô �m‰m˜HÓ%ˆØ�i‰i‹kˆØ×Ñ˜Ÿ™Ð#LÔMØ×ÑØ�H‰H�Q‰KÐMô	
ð 	×Ñ˜Ÿ™›¨Ô1ØFˆØ—K‘K“Mˆ	Ø×ÑØ�{²)¹[Ð$Iõ	
r5   c                 ó\  — d}t        j                  |«      }|j                  «       }| j                  |j                  d«       | j                  |j
                  d   d«       | j                  |j                  «       |«       d}|j                  «       }| j                  |||›d|›�«       y)zœ
        L{URL.asIRI} decodes any percent-encoded text in the URI, making it
        more suitable for reading by humans, and returns a new L{URL}.
        rì   zxn--9ca.comr   z%C3%A9u   http://Ã©.com/Ã©?Ã¡=Ã­#ÃºrÙ   N)r   r\   ÚasIRIr*   r(   r)   r^   )r.   Úasciiishrï   rl   ÚexpectedIRIÚ	actualIRIs         r3   Ú
test_asIRIzTestURL.test_asIRI  s–   € ð DˆÜ�m‰m˜HÓ%ˆØ�i‰i‹kˆØ×Ñ˜Ÿ™ =Ô1Ø×Ñ˜Ÿ™ !™ hÔ/Ø×Ñ˜Ÿ™›¨Ô1ð3ð 	ð —K‘K“Mˆ	Ø×ÑØ�{²)¹[Ð$Iõ	
r5   c                 ó¦   — d}t        j                  |«      }|j                  «       }d}|j                  «       }| j	                  |||›d|›�«       y)zœ
        Bad UTF-8 in a path segment, query parameter, or fragment results in
        that portion of the URI remaining percent-encoded in the IRI.
        z http://xn--9ca.com/%00%FF/%C3%A9u   http://Ã©.com/%00%FF/Ã©rÙ   N)r   r\   rô   r^   r*   )r.   ÚurlWithBinaryrï   rl   rö   r÷   s         r3   Útest_badUTF8AsIRIzTestURL.test_badUTF8AsIRI#  sS   € ð ;ˆÜ�m‰m˜MÓ*ˆØ�i‰i‹kˆð2ð 	ð
 —K‘K“Mˆ	Ø×ÑØ�{²)¹[Ð$Iõ	
r5   c                 ó’   — d}t        j                  |«      }|j                  «       }| j                  |j	                  «       |«       y)zT
        A L{URL} composed of non-ASCII text will result in non-ASCII text.
        rë   N)r   r\   rô   r*   r^   )r.   rî   rl   ÚalsoIRIs       r3   Útest_alreadyIRIAsIRIzTestURL.test_alreadyIRIAsIRI6  s?   € ðBð 	ô �m‰m˜HÓ%ˆØ—)‘)“+ˆØ×Ñ˜Ÿ™Ó*¨HÕ5r5   c                 ó’   — d}t        j                  |«      }|j                  «       j                  «       }| j	                  ||«       y)zH
        A L{URL} composed of encoded text will remain encoded.
        rì   N)r   r\   rí   r^   r*   )r.   rð   rï   rñ   s       r3   Útest_alreadyURIAsURIzTestURL.test_alreadyURIAsURIF  s<   € ð
 GˆÜ�m‰m˜KÓ(ˆØ—I‘I“K×'Ñ'Ó)ˆ	Ø×Ñ˜ KÕ0r5   c                 óÂ  — t        j                  d«      }| j                  |j                  d«      d«       | j                  |j                  d«      d«       | j                  |j                  d«       | j                  |j
                  d«       | j                  |j                  «       d«       | j                  |j                  d¬	«      j                  «       d
«       y)z{
        L{URL.from_text} will parse the C{userinfo} portion of the URI
        separately from the host and port.
        z<http://someuser:somepassword@example.com/some-segment@ignoreTz!someuser:somepassword@example.comFzsomeuser:@example.comzsomeuser:somepasswordÚsomeuserz0http://someuser:@example.com/some-segment@ignore©r8   z/http://someuser@example.com/some-segment@ignoreN)r   r\   r*   Ú	authorityr8   Úuserr^   rŸ   r~   s     r3   Útest_userinfozTestURL.test_userinfoP  s½   € ô �m‰mØJó
ˆð 	×ÑØ�M‰M˜$ÓÐ!Dô	
ð 	×Ñ˜Ÿ™ uÓ-Ð/FÔGØ×Ñ˜Ÿ™Ð'>Ô?Ø×Ñ˜Ÿ™ :Ô.Ø×ÑØ�K‰K‹MÐMô	
ð 	×ÑØ�K‰K ˆKÓ,×4Ñ4Ó6Ø=õ	
r5   c                 ó¦   — t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       y)zJ
        L{URL.from_text} parses custom port numbers as integers.
        zhttp://www.example.com:8080/i�  N)r   r\   r*   r7   r^   )r.   ÚportURLs     r3   Útest_portTextzTestURL.test_portTextg  s?   € ô
 —-‘-Ð >Ó?ˆØ×Ñ˜Ÿ™ tÔ,Ø×Ñ˜Ÿ™Ó*Ð,JÕKr5   c                 ój   — | j                  t        j                  d«      j                  «       d«       y)a  
        Although L{URL} instances are mainly for dealing with HTTP, other
        schemes (such as C{mailto:}) should work as well.  For example,
        L{URL.from_text}/L{URL.to_text} round-trips cleanly for a C{mailto:}
        URL representing an email address.
        zmailto:user@example.comN)r*   r   r\   r^   rY   s    r3   Útest_mailtozTestURL.test_mailtop  s+   € ð 	×ÑÜ�M‰MÐ3Ó4×<Ñ<Ó>Ø%õ	
r5   c                 ó  — t        j                  d«      }| j                  |j                  d«       | j                  |j                  d«       | j                  |j
                  d«       | j                  |j                  «       d«       y)zj
        An HTTP URL without a hostname, but with a path, should also round-trip
        cleanly.
        zhttp:relative-pathr   )zrelative-pathFN)r   r\   r*   r(   r)   Úuses_netlocr^   )r.   Úwithout_hosts     r3   Útest_httpWithoutHostzTestURL.test_httpWithoutHost}  sp   € ô —}‘}Ð%9Ó:ˆØ×Ñ˜×*Ñ*¨BÔ/Ø×Ñ˜×*Ñ*Ð,>Ô?Ø×Ñ˜×1Ñ1°5Ô9Ø×Ñ˜×-Ñ-Ó/Ð1EÕFr5   c                 ó®   — d}t        dg¬«      }| j                  |j                  |«       t        ddi¬«      }| j                  |j                  |«       y)z´
        When a L{URL} is created with a C{query} argument, the C{query}
        argument is converted into an N-tuple of 2-tuples, sensibly
        handling dictionaries.
        )©ÚalphaÚbetar  rÌ   r  r  N)r   r*   r,   )r.   r;   rk   s      r3   Útest_queryIterablezTestURL.test_queryIterable‰  sN   € ð (ˆÜÐ*Ð+Ô,ˆØ×Ñ˜Ÿ™ HÔ-Ü˜ &Ð)Ô*ˆØ×Ñ˜Ÿ™ HÕ-r5   c                 óX   — t        ddg¬«      }| j                  |j                  d«       y)zr
        When a L{URL} is created with a C{path} argument, the C{path} is
        converted into a tuple.
        rÊ   rË   ©r)   rÉ   N)r   r*   r)   r~   s     r3   Útest_pathIterablezTestURL.test_pathIterable–  s(   € ô ˜ Ð)Ô*ˆØ×Ñ˜Ÿ™Ð#5Õ6r5   c           	      ó
  ‡ ‡‡—  G d„ dt         «      Št        t        u rdnd}ˆ fd„Š|fˆˆˆ fd„	} |d«        |d«        |d	«        |d
d«        |d«        |dd«       ‰ j                  t        «      5 }t        t        t         ‰«       «      g¬«       ddd«        ‰|d«       ‰ j                  t        «      5 }t        dt        t         ‰«       «      fg¬«       ddd«        ‰||dz   d«       ‰ j                  t        «      5 }t        t        t         ‰«       «      dfg¬«       ddd«        ‰||d«       ‰ j                  t        «      5  t        t        t        t        t        f    ‰«       «      g¬«       ddd«       ‰ j                  t        «      5  t        t        t        t        t        f   d«      g¬«       ddd«       ‰ j                  t        «      5  t        t        t        t        t        f   d«      g¬«       ddd«       t        j                  d«      }‰ j                  t        «      5 }|j                  t        t         ‰«       «      «       ddd«        ‰||d«       ‰ j                  t        «      5 }|j                  t        t         ‰«       «      «       ddd«        ‰||d«       ‰ j                  t        «      5 }|j                  t        t         ‰«       «      «       ddd«        ‰||d«       y# 1 sw Y   �Œ|xY w# 1 sw Y   �Œ?xY w# 1 sw Y   �ŒÿxY w# 1 sw Y   �Œ·xY w# 1 sw Y   �Œ~xY w# 1 sw Y   �ŒExY w# 1 sw Y   ŒúxY w# 1 sw Y   ŒºxY w# 1 sw Y   ŒzxY w)a¤  
        Passing an argument of the wrong type to any of the constructor
        arguments of L{URL} will raise a descriptive L{TypeError}.

        L{URL} typechecks very aggressively to ensure that its constitutent
        parts are all properly immutable and to prevent confusing errors when
        bad data crops up in a method call long after the code that called the
        constructor is off the stack.
        c                   ó   — e Zd Zd„ Zd„ Zy)ú1TestURL.test_invalidArguments.<locals>.Unexpectedc                  ó   — y)NÚwrong© rY   s    r3   Ú__str__z9TestURL.test_invalidArguments.<locals>.Unexpected.__str__¬  s   € àr5   c                  ó   — y)Nú<unexpected>r  rY   s    r3   Ú__repr__z:TestURL.test_invalidArguments.<locals>.Unexpected.__repr__°  s   € à%r5   N)Ú__name__Ú
__module__Ú__qualname__r  r!  r  r5   r3   Ú
Unexpectedr  «  s   „ òó&r5   r%  r&   Ústrc                 ór   •— ‰j                  t        | j                  «      dj                  ||d«      «       y )Nzexpected {0} for {1}, got {2}r   )r*   r&  Ú	exceptionr§   )ÚraisedÚexpectationr¹   r.   s      €r3   ÚassertRaisedz3TestURL.test_invalidArguments.<locals>.assertRaised¶  s4   ø€ à×ÑÜ�F×$Ñ$Ó%Ø/×6Ñ6Ø  ~óõr5   c                 ó’   •— ‰j                  t        «      5 }t        di |  ‰«       i¤Ž d d d «        ‰|| «       y # 1 sw Y   ŒxY w)Nr  )r›   Ú	TypeErrorr   )Úparamr*  r)  r%  r+  r.   s      €€€r3   rA   z,TestURL.test_invalidArguments.<locals>.check¿  sH   ø€ à×"Ñ"¤9Ó-ð -°ÜÑ,�u™j›lÐ+Ò,÷-ñ ˜ ¨eÕ4÷-ð -ús	   —=½Ar%   r(   r-   rƒ   Úboolr8   r7   zint or NoneTyper  Nzpath segmentr¹   rÌ   z or NoneTypezquery parameter valuerº   zquery parameter name)rH   r2   Úvv)rH   zhttps://valid.example.com/zrelative URL)rÞ   Úbytesr&  r›   r-  r   r	   r   r   Ú
ValueErrorr\   rx   rŠ   rŽ   )r.   ÚdefaultExpectationrA   r)  rk   r%  r+  s   `    @@r3   Útest_invalidArgumentszTestURL.test_invalidArgumentsŸ  sÿ  ú€ ô	&œô 	&ô +0´3©,™Y¸EÐô	ð &8÷ 	5ñ 	ˆhŒÙˆfŒÙˆjÔÙˆh˜ÔÙˆjÔÙˆfÐ'Ô(à×ÑœyÓ)ð 	1¨VÜ”dœ4¡£Ó.Ð/Õ0÷	1ñ 	�VÐ/°Ô@à×ÑœyÓ)ð 	<¨VÜ˜¤¤T©:«<Ó 8Ð9Ð:Õ;÷	<ñ 	ØÐ&¨Ñ7Ð9Pô	
ð ×ÑœyÓ)ð 	=¨VÜœœT¡:£<Ó0°'Ð:Ð;Õ<÷	=ñ 	�VÐ/Ð1GÔHð ×ÑœyÓ)ñ 	?Ü”tœE¤$¬ *Ñ-©z«|Ó<Ð=Õ>÷	?ð ×ÑœzÓ*ñ 	CÜ”tœE¤$¬ *Ñ-Ð/?Ó@ÐAÕB÷	Cð ×ÑœzÓ*ñ 	9Ü”tœE¤$¬ *Ñ-¨vÓ6Ð7Õ8÷	9ô �m‰mÐ8Ó9ˆØ×ÑœyÓ)ð 	0¨VØ�I‰I”dœ4¡£Ó.Ô/÷	0á�VÐ/°Ô@Ø×ÑœyÓ)ð 	2¨VØ�K‰KœœT¡:£<Ó0Ô1÷	2á�VÐ/°Ô@Ø×ÑœyÓ)ð 	0¨VØ�I‰I”dœ4¡£Ó.Ô/÷	0á�VÐ/°Õ@÷K	1ñ 	1ú÷
	<ñ 	<ú÷	=ñ 	=ú÷	?ñ 	?ú÷	Cñ 	Cú÷	9ñ 	9ú÷	0ð 	0ú÷	2ð 	2ú÷	0ð 	0úsl   Á8!LÃ #L Ä#L-Å.L:Æ")MÇ()MÉ%M!Ê%M-Ë%M9ÌLÌ L*Ì-L7Ì:MÍMÍMÍ!M*Í-M6Í9Nc                 óê   — | j                  t        «      5 }t        d¬«       ddd«       | j                  t	        j
                  «      dj                  t        d«      «      «       y# 1 sw Y   ŒGxY w)z¸
        Technically, L{str} (or L{unicode}, as appropriate) is iterable, but
        C{URL(path="foo")} resulting in C{URL.from_text("f/o/o")} is never what
        you want.
        rS   r  Nz,expected iterable of text for path, not: {0})r›   r-  r   r*   r&  r(  r§   r'   )r.   r)  s     r3   Ú!test_technicallyTextIsIterableButz)TestURL.test_technicallyTextIsIterableButô  s^   € ð ×ÑœyÓ)ð 	¨VÜ�U�O÷	à×ÑÜ�× Ñ Ó!Ø:×AÑAÄ$ÀuÃ+ÓNõ	
÷	ð 	ús   –A)Á)A2c                 ó´  — t        d¬«      }| j                  |j                  d«       | j                  |j                  «       d«       | j                  t        j                  d«      j                  d«       | j                  t        j                  d«      j                  d«       | j                  t        j                  d«      j                  d«       t        dd¬«      }| j                  |j                  d«       | j                  |j                  «       d«       t        d	¬«      }| j                  |j                  d«       | j                  |j                  «       d
«       t        d¬«      }| j                  |j                  d«       | j                  |j                  «       d«       t        d¬«      }| j                  |j                  d «       | j                  |j                  «       d«       t        j                  d«      }| j                  |j                  d«       t        j                  d«      }| j                  |j                  d«       y )NÚhttps©r%   Tzhttps://zhttps:Fzhttps:/)r%   r  z	git+httpszgit+https://Úmailtozmailto:Úztpzztp:zztp://test.comzztp:test:com)r   r*   r  r^   r\   r~   s     r3   Útest_netloczTestURL.test_netloc  sª  € ä˜Ô!ˆØ×Ñ˜Ÿ™¨$Ô/Ø×Ñ˜Ÿ™›¨
Ô3à×ÑœŸ™ xÓ0×<Ñ<¸eÔDà×ÑœŸ™ yÓ1×=Ñ=¸uÔEà×ÑœŸ™ zÓ2×>Ñ>ÀÔEä˜¨eÔ4ˆØ×Ñ˜Ÿ™¨%Ô0Ø×Ñ˜Ÿ™›¨Ô1ä˜Ô%ˆØ×Ñ˜Ÿ™¨$Ô/Ø×Ñ˜Ÿ™›¨Ô7ä˜Ô"ˆØ×Ñ˜Ÿ™¨%Ô0Ø×Ñ˜Ÿ™›¨	Ô2ä˜ÔˆØ×Ñ˜Ÿ™¨$Ô/Ø×Ñ˜Ÿ™›¨Ô/ä�m‰mÐ,Ó-ˆØ×Ñ˜Ÿ™¨$Ô/ä�m‰m˜NÓ+ˆØ×Ñ˜Ÿ™¨%Õ0r5   c                 óº   — d}t        j                  |«      }|j                  dk(  sJ ‚|j                  dk(  sJ ‚t        |j
                     |j                  k7  sJ ‚y )Nz5https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80/z'2001:0db8:85a3:0000:0000:8a2e:0370:7334r@   )r   r\   r(   r7   r   r%   )r.   Útrk   s      r3   Útest_ipv6_with_portzTestURL.test_ipv6_with_port$  sS   € àCˆÜ�m‰m˜AÓˆØ�x‰xÐDÒDÐDÐDØ�x‰x˜2Š~Ðˆ~Ü˜sŸz™zÑ*¨c¯h©hÒ6Ð6Ñ6r5   c                 óH  — d}t        j                  |«      }|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j
                  dk(  sJ ‚|j                  dk(  sJ ‚d}t        j                  |«      }|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j
                  dk(  sJ ‚d	}t        j                  |«      }|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j                  d
k(  sJ ‚|j
                  dk(  sJ ‚y )Nz3https://user:pass@example.com/path/to/here?k=v#nicer8  ú	user:passúexample.com)r)   ÚtoÚhereÚnicez1https://user:pass@127.0.0.1/path/to/here?k=v#nicez	127.0.0.1z-https://user:pass@[::1]/path/to/here?k=v#nicez::1)r   r\   r%   r8   r(   r)   r-   ©r.   Útextrk   s      r3   Ú
test_basiczTestURL.test_basic,  s(  € àDˆÜ�m‰m˜DÓ!ˆØ�z‰z˜WÒ$Ð$Ð$Ø�|‰|˜{Ò*Ð*Ð*Ø�x‰x˜=Ò(Ð(Ð(Ø�x‰xÐ1Ò1Ð1Ð1Ø�|‰|˜vÒ%Ð%Ð%àBˆÜ�m‰m˜DÓ!ˆØ�z‰z˜WÒ$Ð$Ð$Ø�|‰|˜{Ò*Ð*Ð*Ø�x‰x˜;Ò&Ð&Ð&Ø�x‰xÐ1Ò1Ð1Ð1à>ˆÜ�m‰m˜DÓ!ˆØ�z‰z˜WÒ$Ð$Ð$Ø�|‰|˜{Ò*Ð*Ð*Ø�x‰x˜5Ò Ð Ð Ø�x‰xÐ1Ò1Ð1Ñ1r5   c                 óN   — | j                  t        t        j                  d«       y )Nz#

©r›   r   r   r\   rY   s    r3   Útest_invalid_urlzTestURL.test_invalid_urlD  s   € à×Ñœ-¬¯©¸Õ@r5   c                 óN   — | j                  t        t        j                  d«       y )Nzhttp://abc:

/#rJ  rY   s    r3   Útest_invalid_authority_urlz"TestURL.test_invalid_authority_urlH  s   € à×Ñœ-¬¯©Ð8KÕLr5   c                 óÜ   — g d¢}|D ]c  }d|z   dz   }| j                  t        j                  t        t        j                  |«       | j                  t
        t        j                  |«       Œe y )N)z2001::0234:C1ab::A0:aabc:003Fz2001::1::3Fú:z::::z::256.0.0.1zhttp://[ú])r›   ÚsocketÚerrorr   ÚAF_INET6r   r   r\   )r.   Úinvalid_ipv6_ipsÚipr‹   s       r3   Útest_invalid_ipv6zTestURL.test_invalid_ipv6L  s]   € ò
Ðð #ò 	FˆBØ! B‘¨Ñ,ˆHØ×ÑœfŸl™l¬I´v·±ÈÔKØ×Ñœm¬S¯]©]¸HÕEñ	Fr5   c                 ó˜   — | j                  t        t        j                  d«       | j                  t        t        j                  d«       y )Nzftp://portmouth:smashz+http://reader.googlewebsite.com:neverforget)r›   r   r   r\   r2  rY   s    r3   Útest_invalid_portzTestURL.test_invalid_portZ  s4   € à×Ñœ-¬¯©Ð8OÔPØ×ÑÜÜ�M‰MØ9õ	
r5   c                 ó   — t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       | j                  |j                  «       j	                  «       d«       t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       | j                  |j                  «       j	                  «       d«       y )Nu   http://bÃ¼cher.chu
   bÃ¼cher.chzhttp://xn--bcher-kva.chr   zxn--bcher-kva.chu   https://bÃ¼cher.ch)r   r\   r*   r(   r^   rÄ   rj   rÓ   s      r3   Ú	test_idnazTestURL.test_idnac  s·   € ä�]‰]Ð.Ó/ˆØ×Ñ˜Ÿ™ ,Ô/Ø×Ñ˜Ÿ™›Ð':Ô;Ø×Ñ˜Ÿ™›×,Ñ,Ó.Ð0IÔJä�]‰]Ð5Ó6ˆØ×Ñ˜Ÿ™Ð"4Ô5Ø×Ñ˜Ÿ™›Ð'AÔBØ×Ñ˜Ÿ™›×,Ñ,Ó.Ð0DÕEr5   c                 ó  — t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       t        j                  d	«      }| j                  |j                  d
«       | j                  |j	                  «       d	«       t        j                  d«      }| j                  |j                  d«       | j                  |j	                  «       d«       t        ddd¬«      }| j                  |j	                  «       d«       t        d
ddd¬«      }| j                  |j	                  «       d«       t        j                  d«      }|j                  d¬«      }| j                  |j	                  «       d«       d}t        j                  |«      }|j                  d¬«      }| j                  |j	                  «       d«       |j                  d¬«      }| j                  |j	                  «       |«       y )Nzmailto:mahmoud@hatnote.comr:  zhttp://hatnote.comr?   znewscheme:a:b:cÚ	newschemeznewerscheme://a/b/cÚnewerschemez%git+ftp://gitstub.biz/glyph/lefkowitzzgit+ftpz'what+mailto:freerealestate@enotuniq.orgzwhat+mailtor;  )ÚxrÀ   ÚzT)r%   r)   rƒ   z
ztp:/x/y/z)r^  rÀ   r_  r   )r%   r)   rƒ   r  zgit+ftp:///x/y/z/zfile:///path/to/heckr9  zmailto:/path/to/heckzunregisteredscheme:///a/b/cF)r  zunregisteredscheme:/a/b/c)r   r\   r*   r%   r^   rŸ   )r.   rk   Úurl2r‹   Úno_netloc_urlÚ
netloc_urls         r3   Útest_netloc_slasheszTestURL.test_netloc_slasheso  s_  € ô �m‰mÐ8Ó9ˆØ×Ñ˜Ÿ™ XÔ.Ø×Ñ˜Ÿ™›Ð(DÔEä�m‰mÐ0Ó1ˆØ×Ñ˜Ÿ™ VÔ,Ø×Ñ˜Ÿ™›Ð(<Ô=ô �m‰mÐ-Ó.ˆØ×Ñ˜Ÿ™ [Ô1Ø×Ñ˜Ÿ™›Ð(9Ô:ä�m‰mÐ1Ó2ˆØ×Ñ˜Ÿ™ ]Ô3Ø×Ñ˜Ÿ™›Ð(=Ô>ô �m‰mÐCÓDˆØ×Ñ˜Ÿ™ YÔ/Ø×Ñ˜Ÿ™›Ð(OÔPä�m‰mÐEÓFˆØ×Ñ˜Ÿ™ ]Ô3Ø×ÑØ�K‰K‹MÐDô	
ô ˜ _¸TÔBˆØ×Ñ˜Ÿ™›¨Ô5ô ØØ$ØØô	
ˆð 	×Ñ˜Ÿ™›Ð(;Ô<ô �m‰mÐ2Ó3ˆØ�{‰{ (ˆ{Ó+ˆØ×Ñ˜Ÿ™›Ð)?Ô@à0ˆÜ�m‰m˜HÓ%ˆØŸ™°˜Ó6ˆØ×Ñ˜×.Ñ.Ó0Ð2MÔNØ—[‘[¨T�[Ó2ˆ
Ø×Ñ˜×+Ñ+Ó-¨xÔ8àr5   c                 óæ   — t        dg¬«      }| j                  |j                  «       d«       |j                  d¬«      }| j                  |j                  «       d«       | j	                  ||«       y)z•
        On host-relative URLs, the C{rooted} flag can be updated to indicate
        that the path should no longer be treated as absolute.
        rÊ   r  T)rƒ   z/helloN)r   r*   r^   rŸ   rr   )r.   ÚaÚbs      r3   Útest_rooted_to_relativezTestURL.test_rooted_to_relativeª  s\   € ô �g�YÔˆØ×Ñ˜Ÿ™› gÔ.Ø�I‰I˜TˆIÓ"ˆØ×Ñ˜Ÿ™› hÔ/Ø×Ñ˜A˜qÕ!r5   c                 ó   — t        ddgd¬«      }| j                  |j                  d«       t        dgd¬«      }| j                  |j                  d«       | j                  ||«       t        ddgd¬«      }t        ddg¬«      }| j                  ||«       | j                  |j                  d«       | j                  |j                  d«       y	)
a	  
        The C{rooted} flag can be updated in some cases, but it cannot be made
        to conflict with other facts surrounding the URL; for example, all URLs
        involving an authority (host) are inherently rooted because it is not
        syntactically possible to express otherwise; also, once an unrooted URL
        gains a path that starts with an empty string, that empty string is
        elided and it becomes rooted, because these cases are syntactically
        indistinguisable in real URL text.
        r   rS   F)r)   rƒ   TrT   )r(   r)   rƒ   )r(   r)   N)r   r*   rƒ   )r.   Úrelative_path_rootedÚrelative_flag_rootedÚattempt_unrooted_absoluteÚnormal_absolutes        r3   Útest_autorootedzTestURL.test_autorooted¶  sÁ   € ô  #¨¨U¨¸EÔBÐØ×ÑÐ-×4Ñ4°dÔ;Ü"¨¨¸Ô=ÐØ×ÑÐ-×4Ñ4°dÔ;Ø×ÑÐ-Ð/CÔDä$'¨U¸%¸ÈÔ$OÐ!Ü 5°¨wÔ7ˆØ×ÑÐ2°OÔDØ×Ñ˜×/Ñ/°Ô6Ø×ÑÐ2×9Ñ9¸4Õ@r5   c                 óÈ  — t        ddd¬«      }t        dd¬«      }t        ddd¬«      }| j                  |j                  d«       | j                  |j                  d«       | j                  |j                  d«       t        j                  d«      }| j                  t	        |«      t	        |«      «       | j                  t	        |«      t	        |«      «       | j                  |j                  «       |j                  «       «       | j                  ||«       | j                  ||«       | j                  ||«       | j                  ||«       | j                  ||«       y)	a¤  
        URLs which include a ``://`` netloc-separator for any reason are
        inherently rooted, regardless of the value or presence of the
        ``rooted`` constructor argument.

        They may include a netloc-separator because their constructor was
        directly invoked with an explicit host or port, or because they were
        parsed from a string which included the literal ``://`` separator.
        Úudpi$  F)r%   r7   rƒ   )r%   r7   Tzudp://:4900N)r   r*   rƒ   r\   r&  ÚasText)r.   Údirectly_constructedÚdirectly_constructed_implictÚdirectly_constructed_rootedÚparseds        r3   Ú!test_rooted_with_port_but_no_hostz)TestURL.test_rooted_with_port_but_no_hostÍ  s-  € ô  #¨%°dÀ5ÔIÐÜ'*°%¸dÔ'CÐ$Ü&)°¸TÈ$Ô&OÐ#Ø×ÑÐ-×4Ñ4°dÔ;Ø×ÑÐ5×<Ñ<¸dÔCØ×ÑÐ4×;Ñ;¸TÔBÜ—‘˜}Ó-ˆØ×ÑœÐ1Ó2´C¸³KÔ@Ø×ÑœÐ9Ó:¼CÀ»KÔHØ×ÑÐ-×4Ñ4Ó6¸¿¹»ÔHØ×ÑÐ-¨vÔ6Ø×ÑÐ-Ð/KÔLØ×ÑÐ-Ð/JÔKØ×ÑÐ5°vÔ>Ø×ÑÐ4°fÕ=r5   c                 óà   — | j                  t        «      5  t        t        «       d d d «       | j                  t        «      5  t        d«       d d d «       y # 1 sw Y   Œ3xY w# 1 sw Y   y xY w)NÚHTTP_____more_like_imHoTTeP)r›   r2  r   r]   rY   s    r3   Útest_wrong_constructorzTestURL.test_wrong_constructorè  s_   € à×ÑœzÓ*ñ 	ä”	ŒN÷	ð ×ÑœzÓ*ñ 	/äÐ-Ô.÷	/ð 	/÷	ð 	ú÷	/ð 	/ús   –AÁA$ÁA!Á$A-c                 ó:  — t        j                  d«      }|j                  dk(  sJ ‚|j                  d¬«      }|j	                  «       }|j                  d¬«      dk(  sJ ‚|j                  d¬«      d	k(  sJ ‚|j                  «       j                  d¬«      d
k(  sJ ‚y )Nzhttp://user:pass@example.comrA  zus%20her:passr  Trc   zhttp://us her:pass@example.comFzhttp://us her:@example.comz http://us%20her:pass@example.com)r   r\   r8   rŸ   rj   r^   rÄ   ©r.   rk   rl   s      r3   Útest_encoded_userinfozTestURL.test_encoded_userinfoñ  s�   € ä�m‰mÐ:Ó;ˆØ�|‰|˜{Ò*Ð*Ð*Ø�k‰k ?ˆkÓ3ˆØ�j‰j‹lˆà�K‰K dˆKÓ+Ð/OÒOð	
ØOà�{‰{¨ˆ{Ó/Ð3OÒOÐOÐOà�J‰J‹L× Ñ ¨tÐ Ó4Ø1ò2ð	
ñ2r5   c                 óv  — i }t        j                  d«      }t        |«      t        |«      k(  sJ ‚d||<   t        j                  d«      }|j                  dd«      }d||<   t	        |«      dk(  sJ ‚t        |j                  «       «      dgk(  sJ ‚t        t        «       «      t        t        «       «      k(  sJ ‚y )Nz.http://blog.hatnote.com/ask?utm_source=geocityr
   zhttp://blog.hatnote.com/askÚ
utm_sourceÚgeocityr   )r   r\   Úhashrµ   ÚlenÚlistÚvalues)r.   Úurl_mapÚurl1r`  s       r3   Ú	test_hashzTestURL.test_hash   s¥   € àˆÜ�}‰}ÐMÓNˆÜ�D‹zœT $›ZÒ'Ð'Ð'àˆ�‰ä�}‰}Ð:Ó;ˆØ�x‰x˜ iÓ0ˆàˆ�‰ä�7‹|˜qÒ Ð Ð Ü�G—N‘NÓ$Ó%¨!¨Ò,Ð,Ð,ä”C“E‹{œd¤3£5›kÒ)Ð)Ñ)r5   c                 ó~   — t        «       }t        |«      }t        |«      dkD  sJ ‚d|vsJ ‚d|vsJ ‚d|vsJ ‚d|vsJ ‚y )Né   r�   rp  rí   rô   )r   Údirr€  )r.   rk   r�   s      r3   Útest_dirzTestURL.test_dir  sZ   € ä‹eˆÜ�#‹hˆä�3‹x˜"Š}Ðˆ}à Ñ$Ð$Ð$Ø˜sÑ"Ð"Ð"Ø˜cÑ!Ð!Ð!Ø˜cÑ!Ð!Ñ!r5   c                 óž   — t        j                  d«      }|j                  «       dk(  sJ ‚|j                  «       j                  «       dk(  sJ ‚y )Nu"   http://example.com/a%20tÃ©%C3%A9stz&http://example.com/a%20t%C3%A9%C3%A9st)r   r�   rp  rí   r~   s     r3   Útest_twisted_compatzTestURL.test_twisted_compat  sD   € ä�l‰lÐ?Ó@ˆØ�z‰z‹|ÐCÒCÐCÐCØ�y‰y‹{×!Ñ!Ó#Ð'OÒOÐOÑOr5   c                 ó    — t        j                  d«      }|j                  dd«      }|j                  dd«      }|j	                  «       dk(  sJ ‚y )Nzhttp://example.com/?a=b&cr^  rÀ   z!http://example.com/?a=b&x=x&c&x=y)r   r\   rµ   r°   r^   r~   s     r3   Útest_set_orderingzTestURL.test_set_ordering%  sH   € ô �m‰mÐ7Ó8ˆØ�g‰g�c˜3ÓˆØ�g‰g�c˜3ÓˆØ�{‰{‹}Ð CÒCÐCÑCr5   c                 óä  — t        j                  d«      }t        j                  |j                  «       «      }||k(  sJ ‚t        j                  |j                  «       j                  «       «      }||k(  sJ ‚||k(  sJ ‚t        j                  d«      }|j                  «       }|j                  «       dk(  sJ ‚t        j                  |j                  «       «      j	                  «       }||k(  sJ ‚y)zSee issue #4z#urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoobz1first-segment/urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoobz'first-segment/urn:ietf:wg:oauth:2.0:oobN)r   r\   r^   rj   rÄ   )r.   rÔ   r‘   r’   Úu4Úu5Úu6s          r3   Útest_schemeless_pathzTestURL.test_schemeless_path0  s¾   € ô �]‰]Ð@ÓAˆÜ�]‰]˜2Ÿ:™:›<Ó(ˆØ�RŠxˆˆxä�]‰]˜2Ÿ9™9›;×.Ñ.Ó0Ó1ˆØ�RŠxˆˆxØ�RŠxˆˆxô �]‰]ÐNÓOˆØ�Y‰Y‹[ˆØ�z‰z‹|ÐHÒHÐHÐHä�]‰]˜2Ÿ:™:›<Ó(×/Ñ/Ó1ˆØ�RŠxˆ‰xr5   c                 ón   — t        j                  d«      }|j                  «       }|j                  «        y)z4See issue #7, affecting only narrow builds (2.6-3.3)zhttps://xn--vi8hiv.wsN)r   r\   rj   r^   rz  s      r3   Útest_emoji_domainzTestURL.test_emoji_domainC  s'   € ô �m‰mÐ3Ó4ˆØ�j‰j‹lˆØ�‰�r5   c                 óæ   — | j                  t        t        dd¬«       | j                  t        t        d¬«       | j                  t        t        d¬«       | j                  t        t        d¬«       y	)
zPer issue #6 and #8r?   za/c)r%   r(   )ú?r  )ú#)ú&rf   rÌ   N)r›   r2  r   rY   s    r3   Útest_delim_in_paramzTestURL.test_delim_in_paramK  sZ   € ð 	×Ñœ*¤c°&¸uÐÔEØ×Ñœ*¤c°ÐÔ7Ø×Ñœ*¤c°ÐÔ7Ø×Ñœ*¤c°-ÐÕAr5   c                 óŒ  — t        j                  d«      }t        j                  d«      }||k(  sJ ‚t        j                  d«      }t        j                  d«      }||k(  sJ ‚t        j                  d«      }t        j                  d«      }||k(  sJ ‚t        j                  d«      }t        j                  d«      }||k(  sJ ‚y )Nzhttp://example.com/zhttp://example.com)r   r\   rÓ   s      r3   Útest_empty_paths_eqzTestURL.test_empty_paths_eqS  s¦   € ä�]‰]Ð0Ó1ˆÜ�]‰]Ð/Ó0ˆà�RŠxˆˆxä�]‰]Ð/Ó0ˆÜ�]‰]Ð/Ó0ˆà�RŠxˆˆxä�]‰]Ð/Ó0ˆÜ�]‰]Ð0Ó1ˆà�RŠxˆˆxä�]‰]Ð0Ó1ˆÜ�]‰]Ð0Ó1ˆà�RŠxˆ‰xr5   c                 óð   — t        j                  d«      j                  dk(  sJ ‚| j                  t        t         j                  d«       | j                  t        t         j                  t        «       «       y )Nz#okÚoks   bytes://x.y.z)r   r\   r-   r›   r-  rÞ   rY   s    r3   Útest_from_text_typezTestURL.test_from_text_typei  sN   € ä�}‰}˜UÓ#×,Ñ,°Ò4Ð4Ð4Ø×Ñœ)¤S§]¡]Ð4DÔEØ×Ñœ)¤S§]¡]´F³HÕ=r5   c                 ó
  — | j                  t        t        j                  d«       | j                  t        t        j                  d«       | j                  t        t        j                  d«       | j                  t        t        j                  d«       | j                  t        t        j                  d«       | j                  t        t        j                  d«       | j                  t        t        j                  d«       y )Nzhttp://[::1/zhttp://::1]/zhttp://[[::1]/zhttp://[::1]]/zhttp://127.0.0.1:zhttp://127.0.0.1:hizhttp://127.0.0.1::80rJ  rY   s    r3   Útest_from_text_bad_authorityz$TestURL.test_from_text_bad_authorityo  s¥   € ð 	×Ñœ-¬¯©¸ÔGØ×Ñœ-¬¯©¸ÔGØ×Ñœ-¬¯©Ð8HÔIØ×Ñœ-¬¯©Ð8HÔIð 	×Ñœ-¬¯©Ð8KÔLà×Ñœ-¬¯©Ð8MÔNà×Ñœ-¬¯©Ð8NÕOr5   c                 ó4  — t        j                  d«      }|j                  d«      g k(  sJ ‚|j                  d«      dgk(  sJ ‚t        |j                  «      dk(  sJ ‚|j                  «       }|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j                  dk(  sJ ‚|j                  d«      d	gk(  sJ ‚|j                  d
k(  sJ ‚|j                  «       dk(  sJ ‚|j                  ddddd¬«      }||k(  sJ ‚t        j                  d«      }|j                  «       }|j                  «       dk(  sJ ‚t        j                  d«      }|j                  «       }|j                  «       dk(  sJ ‚t        d¬«      j                  d¬«      j                  «       dk(  sJ ‚t        d¬«      j                  «       j                  «       dk(  sJ ‚t        dddgdgdd¬«      }|j                  d¬«      d k(  sJ ‚|j                  «       j                  d¬«      d!k(  sJ ‚y )"Nz0HTTP://Example.com/A%61/./../A%61?B%62=C%63#D%64ÚBbzB%62zC%63é   r?   rB  )ÚAaÚCcÚDdzhttp://example.com/Aa?Bb=Cc#DdFrW   zhttp://example.iozhttp://example.io/z/a%2fb/cd%3f?k%3d=v%23#testz/a%2Fb/cd%3F?k%3D=v%23#test)r   z%te%stsr  )Úpercentsz/%te%stsz/%25te%25stsÚftpz%%%z%a%b)ú%z%%r©  z%:%)r%   r)   r,   r-   r8   Trc   zftp://%:%@/%%%/%a%b?%=%%#%z0ftp://%25:%25@/%25%25%25/%25a%25b?%25=%25%25#%25)
r   r\   rÃ   r€  r)   Ú	normalizer%   r(   r-   r^   )	r.   rk   Únorm_urlÚnoop_norm_urlÚslashless_urlÚslashful_urlÚdelimited_urlÚnorm_delimited_urlÚpercenty_urls	            r3   Útest_normalizezTestURL.test_normalize  sJ  € ä�m‰mÐNÓOˆØ�w‰w�t‹} Ò"Ð"Ð"Ø�w‰w�v‹ 6 (Ò*Ð*Ð*Ü�3—8‘8‹} Ò!Ð!Ð!ð —=‘=“?ˆà�‰ &Ò(Ð(Ð(Ø�}‰} Ò-Ð-Ð-Ø�}‰} Ò'Ð'Ð'Ø�|‰|˜DÓ! d VÒ+Ð+Ð+Ø× Ñ  DÒ(Ð(Ð(Ø×ÑÓ!Ð%EÒEÐEÐEð Ÿ™Ø˜u¨5¸Èð &ó 
ˆð  Ò#Ð#Ð#ô Ÿ™Ð&9Ó:ˆØ$×.Ñ.Ó0ˆØ×#Ñ#Ó%Ð)=Ò=Ð=Ð=ô Ÿ™Ð&CÓDˆØ*×4Ñ4Ó6ÐØ!×)Ñ)Ó+Ð/LÒLÐLÐLô �_Ô%×/Ñ/¸Ð/Ó?×GÑGÓIØòð	
ðô ˜Ô(×2Ñ2Ó4×<Ñ<Ó>À.ÒPÐPÐPäØØ˜�Ø�-ØØô
ˆð × Ñ ¨tÐ Ó4Ø+ò,ð	
ð,ð ×"Ñ"Ó$×,Ñ,¸4Ð,Ó@ØAòBð	
ñBr5   c                 óX  — d}t        j                  |«      }t        |«      |k(  sJ ‚t        |«      dk(  sJ ‚t        r7t        t        |«      t        «      sJ ‚t        t        |«      t        «      sJ ‚y t        t        |«      t        «      sJ ‚t        t        |«      t        «      sJ ‚y )Nu&   http://example.com/Ã¡/y%20a%20y/?b=%25s*   http://example.com/%C3%A1/y%20a%20y/?b=%25)r   r\   r&   r1  ÚPY2r$   r&  rF  s      r3   Útest_strzTestURL.test_str¸  s�   € ð 8ˆÜ�m‰m˜DÓ!ˆÜ�s‹|˜tÒ#Ð#Ð#Ü�S‹zÐJÒJÐJÐJåÜœc #›h¬Ô.Ð.Ð.Üœg c›l¬GÔ4Ð4Ñ4äœc #›h¬Ô0Ð0Ð0Üœe C›j¬%Ô0Ð0Ñ0r5   c                 ó.  — t        j                  d«      }|j                  «       j                  dk(  sJ ‚|j	                  «       j                  dk(  sJ ‚t        j                  d«      }|j                  «       j                  dk(  sJ ‚|j	                  «       j                  dk(  sJ ‚|j	                  «       j                  «       j                  dk(  sJ ‚d}t        j                  |«      j	                  «       j                  «       j                  dk(  sJ ‚y )	Nu   http://abÃ©.com/u   abÃ©.comzxn--ab-cja.comu(   http://ãƒ‰ãƒ¡ã‚¤ãƒ³.ãƒ†ã‚¹ãƒˆ.co.jp#testu   ãƒ‰ãƒ¡ã‚¤ãƒ³.ãƒ†ã‚¹ãƒˆ.co.jpzxn--eckwd4c7c.xn--zckzah.co.jpzhttp://Example.comrB  )r   r\   rj   r(   rÄ   Úget_decoded_url)r.   rk   rG  s      r3   Útest_idna_cornerszTestURL.test_idna_cornersÈ  så   € ä�m‰mÐ.Ó/ˆØ�z‰z‹|× Ñ  JÒ.Ð.Ð.Ø�z‰z‹|× Ñ Ð$4Ò4Ð4Ð4ä�m‰mÐFÓGˆØ�z‰z‹|× Ñ Ð$BÒBÐBÐBØ�z‰z‹|× Ñ Ð$DÒDÐDÐDà�z‰z‹|×+Ñ+Ó-×2Ñ2Ð6TÒTÐTÐTà#ˆä�M‰M˜$Ó×&Ñ&Ó(×8Ñ8Ó:×?Ñ?À=ÒPð	
ÙPr5   N)r   )Or"  r#  r$  Ú__doc__r4   r<   rB   rN   rQ   rZ   ra   rh   rp   rs   ru   ry   r   r…   r‡   rŒ   r“   r™   r�   r    r©   r±   r¶   r½   rÅ   rÇ   rÍ   rÐ   rÕ   rÛ   rß   râ   rå   rç   ré   rò   rø   rû   rþ   r   r  r	  r  r  r  r  r4  r6  r<  r?  rH  rK  rM  rV  rX  rZ  rc  rg  rm  ru  rx  r{  r…  r‰  r‹  r�  r’  r”  r™  r›  rž  r   r²  rµ  r¸  r  r5   r3   r!   r!   ‘   s�  „ ñò=ð6 ó1+òf+ò
ò&	
ò
ò(7ò+òò
ò 

ò
ò0	
òEò+ò
ò&<Cò|BòEò5ò((òT%
òN
ò,
ò2>ò*.ò6òò!ò	$ò	)ò5ò:ò9òMò
ò4
ò0
ò&6ò 1ò
ò.Lò
ò
Gò.ò7òSAòj
ò 1òD7ò2ò0AòMòFò
ò
Fò9òv
"òAò.>ò6/ò
ò*ò$
"òPòDòò&òBòò,>òPò 7
òr1ó 
r5   r!   )Ú
__future__r   ÚsysrQ  Útypingr   r   r   r   r   r	   Úcommonr   r   r   r   Ú_urlr   r   Úversion_infor´  r+   r&   r]   r•   r–   re   r!   r  r5   r3   ú<module>rÀ     so   ðõ (ã 
Û ß =× =å %ß !ß -ð 
×Ñ�qÑ˜QÑ€Ù
ˆr‹(€ð 9€	ð 2Ð ò1Ð ðhA€ôHF
Ðõ F
r5   