Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/test/__pycache__/test_urlparse.cpython-311.pyc

�

SԚg�/���ddlZddlZddlZddlZdZdZdZdZgdgf�dgf�dgf�dd	gf�d
dgf�dd
gf�dd
gf�ddgf�ddgf�dddgf�ddgf�ddgf�dddgf�dddgf�dgf�d gf�d!gf�d"d#gf�d$d%gf�d&d'gf�d(d'gf�d)d*gf�d+d,gf�d-d.d/gf�d0d1gf�d2d.gf�d3d4d5gf�d6d7d8gf�d9d:gf�d;d<gf�d=d>gf�d?d@gf�dAdBgf�dCdBgf�dDdEgf�dFdGgf�dHdGgf�dIdJgf�dKdJgf�Z	gdif�dif�dif�dddgif�d
ddgif�dddgif�dddgif�dddLgif�ddMdNgif�ddOgdPgdQ�f�dddRgif�dddOgif�ddSgdTgd�f�dddUdVgif�dif�d if�d!if�d"ddgif�d$dd&gif�d&d&dgif�d(d&dgif�d)d&dWgif�d+dXdYgif�d-dZgd[gd\�f�d0d&d]gif�d2d&dZgif�d3d^gd_gd.�f�d6d&d`dagif�d9dbdOgif�d;ddcgif�d=dddZgif�d?d&degif�dfd&dggif�dAdhdigif�dCdhdigif�dDdjdjgif�dFdkdlgif�dHdkdlgif�dIdmdngif�dKdmdngif�Z
Gdo�dpej��ZGdq�drej��Z
Gds�dtej��Zedukrej��dSdS)v�N�http://a/b/c/d;p?q#f�http://a/b/c/d;p?q�http://a/b/c/d��&z&&�=)rrz=a)r�ar	)r	rza=za=b=c)r	�b=cza%3Db=c)�a=b�cza=b&c=d�r	�b)r�dz	a=b%26c=d)r	�b&c=dz&a=bza=a+b&b=b+c�r	�a b�r�b cza=1&a=2�r	�1�r	�2��&s&&�=)rrs=a)r�ar)rrsa=sa=b=c)r�b=csa%3Db=c)�a=b�csa=b&c=d�r�b)r�ds	a=b%26c=d)r�b&c=ds&a=bsa=a+b&b=b+c�r�a b�r!�b csa=1&a=2�r�1�r�2�;a=b)�;ar�a=a+b;b=b+c)r	�	a b;b=b c�;a=b)�;ar!�a=a+b;b=b+c)r�	a b;b=b cuŁ=é)�Ł�éz
%C5%81=%C3%A9z%81=%A9)��r6sŁ=é)�Ł�és
%C5%81=%C3%A9s�=�)����s%81=%A9r
rrrr)r	rrrrrrrrrr!r")rrr#r%r'r)r+r-r/r1r3s
a=a%E2%80%99bsa’br4r5r6r7r8r9r:c�Z�eZdZd9d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�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/�Z0d0�Z1d1�Z2d2�Z3d3�Z4d4�Z5d5�Z6d6�Z7d7�Z8d8�Z9dS):�UrlParseTestCaseNc�	�|�|}tj�|��}|�||��|j|j|j|j|j|j	f}|�||��tj�
|��}|�||��|�||�����tj�|�����}|�|���|�����|�||��|�|j|j��|�|j|j��|�|j|j��|�|j|j��|�|j|j��|�|j	|j	��|�|j|j��|�|j
|j
��|�|j|j��|�|j|j��tj�|��}|�||��|j|j|j|j|j	f}|�||��tj�|��}|�||��|�||�����tj�|�����}|�|���|�����|�||��|�|j|j��|�|j|j��|�|j|j��|�|j|j��|�|j	|j	��|�|j|j��|�|j
|j
��|�|j|j��|�|j|j��dS�N)�urllib�parse�urlparse�assertEqual�scheme�netloc�path�params�query�fragment�
urlunparse�geturl�username�password�hostname�port�urlsplit�
urlunsplit)	�self�url�parsed�split�url2�result�t�result2�result3s	         �//usr/local/lib/python3.11/test/test_urlparse.py�checkRoundtripsz UrlParseTestCase.checkRoundtripsjs���<��D���&�&�s�+�+�������(�(�(�
�]�F�M�6�;�
�]�F�L�&�/�
;������F�#�#�#��,�)�)�&�1�1������$�'�'�'�����&�-�-�/�/�2�2�2��,�'�'��
�
���8�8��������)�)�6�=�=�?�?�;�;�;�����6�2�2�2������6�=�9�9�9������6�=�9�9�9������6�;�7�7�7������6�=�9�9�9������6�<�8�8�8�����)�6�?�;�;�;�����)�6�?�;�;�;�����)�6�?�;�;�;�����)�6�?�;�;�;������6�;�7�7�7���&�&�s�+�+�������'�'�'�
�]�F�M�6�;�
�\�6�?�
,������E�"�"�"��,�)�)�&�1�1������$�'�'�'�����&�-�-�/�/�2�2�2��,�'�'��
�
���8�8��������)�)�6�=�=�?�?�;�;�;�����6�2�2�2������6�=�9�9�9������6�=�9�9�9������6�;�7�7�7������6�<�8�8�8�����)�6�?�;�;�;�����)�6�?�;�;�;�����)�6�?�;�;�;�����)�6�?�;�;�;������6�;�7�7�7�7�7rc�$�tD]�\}}tj�|d���}|�||d|z��d�|D��}tj�|d���}|�||d|z����dS)NT��keep_blank_values�Error parsing %rc�<�g|]}t|d���|��S)���len)�.0�vs  rZ�
<listcomp>z-UrlParseTestCase.test_qsl.<locals>.<listcomp>�s'��$D�$D�$D�1�#�a��d�)�)�$D�Q�$D�$D�$DrF)�parse_qsl_test_casesr?r@�	parse_qslrB)rQ�orig�expectrV�expect_without_blankss     rZ�test_qslzUrlParseTestCase.test_qsl�s���0�	7�	7�L�D�&��\�+�+�D�D�+�I�I�F����V�V�-?�$�-F�G�G�G�$D�$D��$D�$D�$D�!��\�+�+�D�E�+�J�J�F����V�%:�.��5�
7�
7�
7�
7�	7�	7rc�*��tD]�\}�tj�|d���}|�|�d|z���fd��D��}tj�|d���}|�||d|z����dS)NTr]r_c�X��i|]&}t�|d���|�|��'S)rrb)rdrerjs  �rZ�
<dictcomp>z,UrlParseTestCase.test_qs.<locals>.<dictcomp>�sJ���%K�%K�%K�)*��F�1�I�a�L�8I�8I�%K�Q��q�	�%K�%K�%KrF)�parse_qs_test_casesr?r@�parse_qsrB)rQrirVrkrjs    @rZ�test_qszUrlParseTestCase.test_qs�s����/�	7�	7�L�D�&��\�*�*�4�4�*�H�H�F����V�V�-?�$�-F�G�G�G�%K�%K�%K�%K�.4�%K�%K�%K�!��\�*�*�4�5�*�I�I�F����V�%:�.��5�
7�
7�
7�
7�
	7�	7rc�x��gd�}d���fd�|D��}||zD]\}}}|�|||���dS)N))�path/to/file)rrrtrrr)rrrtrr)�
/path/to/file�rrrurrr�rrrurr)�//path/to/file)rrE�/to/filerrr)rrEryrr)z////path/to/file)rrrxrrr)rrrxrr)zscheme:path/to/file)rCrrtrrr)rCrrtrr)�scheme:/path/to/file�rCrrurrr�rCrrurr)zscheme://path/to/file)rCrEryrrr)rCrEryrr)zscheme:////path/to/file)rCrrxrrr)rCrrxrr)�file:///tmp/junk.txt��filer�
/tmp/junk.txtrrr�rrr�rr)zfile:////tmp/junk.txt)rr�//tmp/junk.txtrrr)rrr�rr)zfile://///tmp/junk.txt)rr�///tmp/junk.txtrrr)rrr�rr)zimap://mail.python.org/mbox1)�imap�mail.python.org�/mbox1rrr)r�r�r�rr)z1mms://wms.sys.hinet.net/cts/Drama/09006251100.asf)�mms�wms.sys.hinet.net�/cts/Drama/09006251100.asfrrr)r�r�r�rr)znfs://server/path/to/file.txt)�nfs�server�/path/to/file.txtrrr)r�r�r�rr)z0svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/)�svn+ssh�svn.zope.org�/repos/main/ZConfig/trunk/rrr)r�r�r�rr)z)git+ssh://git@github.com/user/project.git)�git+ssh�git@github.com�/user/project.gitrrr)r�r�r�rrc��|d�d��td�|dD����td�|dD����fS)Nr�asciic3�@K�|]}|�d��V��dS�r�N��encode�rd�xs  rZ�	<genexpr>zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>��.����:�:��!�(�(�7�+�+�:�:�:�:�:�:rrac3�@K�|]}|�d��V��dSr�r�r�s  rZr�zDUrlParseTestCase.test_roundtrips.<locals>._encode.<locals>.<genexpr>�r�r��r��tuple�rWs rZ�_encodez1UrlParseTestCase.test_roundtrips.<locals>._encode��[���a�D�K�K��(�(��:�:�Q�q�T�:�:�:�:�:��:�:�Q�q�T�:�:�:�:�:�<�
<rc�&��g|]
}�|����S�r��rdr�r�s  �rZrfz4UrlParseTestCase.test_roundtrips.<locals>.<listcomp>��!���5�5�5�a�w�w�q�z�z�5�5�5r�r[)rQ�	str_cases�bytes_casesrRrSrTr�s      @rZ�test_roundtripsz UrlParseTestCase.test_roundtrips�s���7�7�7�	�p	<�	<�	<�6�5�5�5�9�5�5�5��"+�k�"9�	5�	5��C���� � ��f�e�4�4�4�4�	5�	5rc�|��gd�}d���fd�|D��}||zD]\}}}}|�||||��� dS)N))z///path/to/filerurvrw)zscheme:///path/to/filerzr{r|)zfile:/tmp/junk.txtr}r~r�)zhttp:/tmp/junk.txtzhttp:///tmp/junk.txt)�httprr�rrr)r�rr�rr)zhttps:/tmp/junk.txtzhttps:///tmp/junk.txt)�httpsrr�rrr)r�rr�rrc���|d�d��|d�d��td�|dD����td�|dD����fS)Nrr�rac3�@K�|]}|�d��V��dSr�r�r�s  rZr�zRUrlParseTestCase.test_roundtrips_normalization.<locals>._encode.<locals>.<genexpr>
r�rr�c3�@K�|]}|�d��V��dSr�r�r�s  rZr�zRUrlParseTestCase.test_roundtrips_normalization.<locals>._encode.<locals>.<genexpr>r�r�r�r�s rZr�z?UrlParseTestCase.test_roundtrips_normalization.<locals>._encode
sn���a�D�K�K��(�(��a�D�K�K��(�(��:�:�Q�q�T�:�:�:�:�:��:�:�Q�q�T�:�:�:�:�:�<�
<rc�&��g|]
}�|����Sr�r�r�s  �rZrfzBUrlParseTestCase.test_roundtrips_normalization.<locals>.<listcomp>r�rr�)rQr�r�rRrUrSrTr�s       @rZ�test_roundtrips_normalizationz.UrlParseTestCase.test_roundtrips_normalization�s����
�
�
�	�,	<�	<�	<�
6�5�5�5�9�5�5�5��(1�K�(?�	;�	;�$�C��v�u�� � ��f�e�T�:�:�:�:�	;�	;rc���
�gd�}d��
�
fd�|D��}d}d}||f}||f}||fD];\}}|D]3}	|D].\}
}}|	|
z}
|	f|z}|	f|z}|�|
||���/�4�<dS)N))z://www.python.org)�www.python.orgrrrr)r�rrr)z://www.python.org#abc)r�rrr�abc)r�rrr�)z://www.python.org?q=abc)r�rr�q=abcr)r�rr�r)z://www.python.org/#abc)r��/rrr�)r�r�rr�)z://a/b/c/d;p?q#f)r	z/b/c/d�p�q�f)r	z/b/c/d;pr�r�c��|d�d��td�|dD����td�|dD����fS)Nrr�c3�@K�|]}|�d��V��dSr�r�r�s  rZr�zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>*r�rrac3�@K�|]}|�d��V��dSr�r�r�s  rZr�zIUrlParseTestCase.test_http_roundtrips.<locals>._encode.<locals>.<genexpr>+r�rr�r�r�s rZr�z6UrlParseTestCase.test_http_roundtrips.<locals>._encode(r�rc�&��g|]
}�|����Sr�r�r�s  �rZrfz9UrlParseTestCase.test_http_roundtrips.<locals>.<listcomp>,r�r)r�r�)�http�httpsr�)rQr�r��str_schemes�
bytes_schemes�	str_tests�bytes_tests�schemes�
test_casesrCrRrSrTr�s             @rZ�test_http_roundtripsz%UrlParseTestCase.test_http_roundtripss�������	�"	<�	<�	<�6�5�5�5�9�5�5�5��'��+�
���*�	�#�[�0��$-�{�#;�	=�	=��G�Z�!�
=�
=��*4�=�=�&�C��� �3�,�C�$�Y��/�F�#�I��-�E��(�(��f�e�<�<�<�<�	=�
=�	=�	=rc��|||f}|�tj�||��|��d�|D��x}\}}}|�tj�||��|��dS)Nc�8�g|]}|�d����S�r�r�r�s  rZrfz.UrlParseTestCase.checkJoin.<locals>.<listcomp><s7��8G�8G�8G�23�A�H�H�W�-�-�8G�8G�8Gr)rBr?r@�urljoin)	rQ�base�relurl�expected�str_components�bytes_components�baseb�relurlb�	expectedbs	         rZ�	checkJoinzUrlParseTestCase.checkJoin9s������1�������-�-�d�F�;�;�X�F�F�F�8G�8G�7E�8G�8G�8G�	G��4�5�'�9������-�-�e�W�=�=�y�I�I�I�I�Irc�v�gd�}d�|D��}||zD]�}|�tj�tj�|����|��|�tj�tj�|����|����dS)N)�Pythonz./Python�x-newscheme://foo.com/stuffzx://yzx:/yzx:/r�c�8�g|]}|�d����Sr�r�r�s  rZrfz7UrlParseTestCase.test_unparse_parse.<locals>.<listcomp>B�$��<�<�<�Q�q�x�x��(�(�<�<�<r)rBr?r@rPrOrIrA)rQr�r��us    rZ�test_unparse_parsez#UrlParseTestCase.test_unparse_parse@s���b�b�b�	�<�<�)�<�<�<���[�(�	S�	S�A����V�\�4�4�V�\�5J�5J�1�5M�5M�N�N�PQ�R�R�R����V�\�4�4�V�\�5J�5J�1�5M�5M�N�N�PQ�R�R�R�R�	S�	Src���|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td	d
��|�tdd��|�td
d��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td d��|�td!d"��|�td#d$��|�td%d$��|�td&d��|�td'd(��|�td)d*��|�td+d,��|�td-d.��|�td/d0��|�td1d"��|�td2d��|�td3d4��|�td5d6��dS)7N�g:h�g�http://a/b/c/g�./g�g/�http://a/b/c/g/�/g�
http://a/g�//g�http://g�g?y�http://a/b/c/g?y�g?y/./x�http://a/b/c/g?y/./x�#s�http://a/b/c/d;p?q#s�g#s�http://a/b/c/g#s�g#s/./x�http://a/b/c/g#s/./x�g?y#s�http://a/b/c/g?y#s�g;x�http://a/b/c/g;x�g;x?y#s�http://a/b/c/g;x?y#s�.�
http://a/b/c/�./�..�http://a/b/�../�../g�http://a/b/g�../..�	http://a/�../../�../../grr�g.�http://a/b/c/g.�.g�http://a/b/c/.g�g..�http://a/b/c/g..�..g�http://a/b/c/..g�./../g�./g/.�g/./h�http://a/b/c/g/h�g/../h�http://a/b/c/h)r��RFC1808_BASE�rQs rZ�test_RFC1808zUrlParseTestCase.test_RFC1808Gs������|�U�E�2�2�2����|�S�*:�;�;�;����|�U�,<�=�=�=����|�T�+<�=�=�=����|�T�<�8�8�8����|�U�J�7�7�7����|�U�,>�?�?�?����|�Y�0F�G�G�G����|�T�+A�B�B�B����|�U�,>�?�?�?����|�Y�0F�G�G�G����|�W�.B�C�C�C����|�U�,>�?�?�?����|�Y�0F�G�G�G����|�S�/�:�:�:����|�T�?�;�;�;����|�T�=�9�9�9����|�U�M�:�:�:����|�V�^�<�<�<����|�W�k�:�:�:����|�X�{�;�;�;����|�Y��=�=�=�	
���|�R�)?�@�@�@����|�T�+<�=�=�=����|�T�+<�=�=�=����|�U�,>�?�?�?����|�U�,>�?�?�?����|�X�~�>�>�>����|�W�.?�@�@�@����|�W�.@�A�A�A����|�X�/?�@�@�@�@�@rc�l�|�tj�d��d��dS)Nzmailto:1337@example.org)�mailtorz1337@example.orgrrr�rBr?r@rArs rZ�test_RFC2368zUrlParseTestCase.test_RFC2368ws?�������.�.�/H�I�I�>�	@�	@�	@�	@�	@rc��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td	d
��|�tdd��|�td
d��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd ��|�td!d ��|�td"d��|�td#t��|�td$d%��|�td&d'��|�td(d)��|�td*d+��|�td,d��|�td-d��|�td.d/��|�td0d1��|�td2d3��|�td4d5��|�td6d7��|�td8d9��|�td:d;��|�td<d=��dS)>Nr�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�rrrrrrrrrrr	r
rrr
rrrrr�	g;x=1/./y�http://a/b/c/g;x=1/y�
g;x=1/../y�http://a/b/c/yr�r��g?y/../x�http://a/b/c/g?y/../xr�r��g#s/../x�http://a/b/c/g#s/../x)r��RFC2396_BASErs rZ�test_RFC2396zUrlParseTestCase.test_RFC2396|s"��	
���|�U�E�2�2�2����|�S�*:�;�;�;����|�U�,<�=�=�=����|�T�+<�=�=�=����|�T�<�8�8�8����|�U�J�7�7�7����|�U�,>�?�?�?����|�T�+A�B�B�B����|�U�,>�?�?�?����|�W�.B�C�C�C����|�U�,>�?�?�?����|�Y�0F�G�G�G����|�S�/�:�:�:����|�T�?�;�;�;����|�T�=�9�9�9����|�U�M�:�:�:����|�V�^�<�<�<����|�W�k�:�:�:����|�X�{�;�;�;����|�Y��=�=�=����|�R��6�6�6����|�T�+<�=�=�=����|�T�+<�=�=�=����|�U�,>�?�?�?����|�U�,>�?�?�?����|�X�~�>�>�>����|�W�.?�@�@�@����|�W�.@�A�A�A����|�X�/?�@�@�@����|�[�2H�I�I�I����|�\�3C�D�D�D����|�Y�0F�G�G�G����|�Z�1H�I�I�I����|�Y�0F�G�G�G����|�Z�1H�I�I�I�I�Irc�
�|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td	d
��|�tdd��|�td
d��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td d!��|�td"d!��|�td#d$��|�td%d&��|�td'd&��|�td(d��|�td)d��|�td)d��|�td*d��|�td+d��|�td,d��|�td-d.��|�td/d0��|�td1d2��|�td3d4��|�td5d$��|�td6d
��|�td7d8��|�td9d:��|�td;d<��|�td=d>��|�td?d@��|�tdAdB��|�tdCdD��|�tdEdF��|�tdGd��|�dHdd��dS)IN�?yzhttp://a/b/c/d;p?yz;xzhttp://a/b/c/;xr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�rrrrrz
../../../gz
../../../../gz/./gz/../grrrrr	r
rrr
rrrrrrrrrr�r�rr r�r�r!r"�http:gzhttp://a/b/c/de)r��RFC3986_BASErs rZ�test_RFC3986zUrlParseTestCase.test_RFC3986�s�����|�T�*>�?�?�?����|�T�+<�=�=�=����|�U�5�1�1�1����|�S�)9�:�:�:����|�U�+;�<�<�<����|�T�*;�<�<�<����|�T�,�7�7�7����|�U�:�6�6�6����|�T�*>�?�?�?����|�U�+=�>�>�>����|�T�*@�A�A�A����|�U�+=�>�>�>����|�W�-A�B�B�B����|�T�*;�<�<�<����|�U�+=�>�>�>����|�Y�/E�F�F�F����|�R�(<�=�=�=����|�S��9�9�9����|�T�/�:�:�:����|�T�-�8�8�8����|�U�=�9�9�9����|�V�N�;�;�;����|�W�[�9�9�9����|�X�k�:�:�:����|�Y�|�<�<�<����|�\�<�@�@�@�	
���|�\�,�?�?�?����|�_�\�B�B�B����|�V�L�9�9�9����|�W�\�:�:�:����|�T�*;�<�<�<����|�T�*;�<�<�<����|�U�+=�>�>�>����|�U�+=�>�>�>����|�X�n�=�=�=����|�W�->�?�?�?����|�W�-?�@�@�@����|�X�.>�?�?�?����|�[�1G�H�H�H����|�\�2B�C�C�C����|�Y�/E�F�F�F����|�Z�0G�H�H�H����|�Y�/E�F�F�F����|�Z�0G�H�H�H����|�X�.>�?�?�?�	
���(�$�/@�A�A�A�A�Arc��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd	��|�td
d��|�tdd
��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�tdd��|�td d	��|�td!d"��|�td#d$��|�tdd��|�tdd��|�td%d��|�td&d��|�td'd��|�d(dd(��|�d)dd��|�d)d*d*��|�d+d,d-��|�d.d,d/��|�d0dd1��|�d2dd3��|�td4zd5td6z��|�d7d8d9��|�d:d8d;��|�d7d<d=��|�d:d<d=��|�d7d>d?��|�dd8d=��|�d@dAdA��dS)BNr�r'r��http:rr�r�r�r�r�r�r�r�r&zhttp://a/b/c/d?yr�r�r�r�r�r�r�r�r�r�r�rrrrr
rrrrrzhttp:?yzhttp:g?yzhttp:g?y/./xzhttp:///rzhttp://a/./gzsvn://pathtorepo/dir1�dir2zsvn://pathtorepo/dir2zsvn+ssh://pathtorepo/dir1zsvn+ssh://pathtorepo/dir2zws://a/bzws://a/gz	wss://a/bz	wss://a/gr��fooz/foozhttp://a/b/c/d/e/z
../../f/g/zhttp://a/b/c/f/g/zhttp://a/b/c/d/ezhttp://a/b/f/g/z/../../f/g/z
http://a/f/g/z	../../f/gzhttp://a/b/c/f/gr	r)r��SIMPLE_BASErs rZ�
test_urljoinszUrlParseTestCase.test_urljoins�s������{�E�%�0�0�0����{�H�-=�>�>�>����{�G�,<�=�=�=����{�C�(8�9�9�9����{�E�*:�;�;�;����{�D�):�;�;�;����{�D��6�6�6����{�E�*�5�5�5����{�D�);�<�<�<����{�E�*<�=�=�=����{�I�.D�E�E�E����{�C��8�8�8����{�D��9�9�9����{�D��7�7�7����{�E�-�8�8�8����{�F�>�:�:�:����{�G�K�8�8�8����{�I�l�;�;�;����{�H�^�<�<�<����{�G�,=�>�>�>����{�G�,>�?�?�?����{�H�-=�>�>�>����{�H�-=�>�>�>����{�G�,<�=�=�=����{�I�.@�A�A�A����{�J�/A�B�B�B����{�N�3I�J�J�J����z�4�
�3�3�3����r�1�2H�I�I�I����r�>�>�:�:�:����.��8O�P�P�P����2�F�<W�X�X�X����z�#�j�1�1�1����{�3�{�3�3�3�	
���{�S�(�%��v�1E�F�F�F�	
���*�L�:M�N�N�N����)�<�9J�K�K�K����*�M�?�K�K�K����)�=�/�J�J�J����*�K�9K�L�L�L����}�l�O�D�D�D�	
���s�C��%�%�%�%�%rc�V��gd�}d���fd�|D��}||zD]I\}}}tj�|��}|�|j|jf||f���Jgd�}d�|D��}||zD]-}|�ttjj|���.dS)N))z http://Test.python.org:5432/foo/�test.python.org�8)zhttp://12.34.56.78:5432/foo/�12.34.56.78r2)zhttp://[::1]:5432/foo/�::1r2)zhttp://[dead:beef::1]:5432/foo/�dead:beef::1r2)zhttp://[dead:beef::]:5432/foo/�dead:beef::r2)z:http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/�'dead:beef:cafe:5417:affe:8fa3:deaf:feedr2)z http://[::12.34.56.78]:5432/foo/�
::12.34.56.78r2)z%http://[::ffff:12.34.56.78]:5432/foo/�::ffff:12.34.56.78r2)zhttp://Test.python.org/foo/r1N)zhttp://12.34.56.78/foo/r3N)zhttp://[::1]/foo/r4N)zhttp://[dead:beef::1]/foo/r5N)zhttp://[dead:beef::]/foo/r6N)z5http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/r7N)zhttp://[::12.34.56.78]/foo/r8N)z http://[::ffff:12.34.56.78]/foo/r9N)zhttp://Test.python.org:/foo/r1N)zhttp://12.34.56.78:/foo/r3N)zhttp://[::1]:/foo/r4N)zhttp://[dead:beef::1]:/foo/r5N)zhttp://[dead:beef::]:/foo/r6N)z6http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:/foo/r7N)zhttp://[::12.34.56.78]:/foo/r8N)z!http://[::ffff:12.34.56.78]:/foo/r9Nc�|�|d�d��|d�d��|dfS)Nrr�rar�r�r�s rZr�z.UrlParseTestCase.test_RFC2732.<locals>._encode:s3���Q�4�;�;�w�'�'��1����W�)=�)=�q��t�C�Crc�&��g|]
}�|����Sr�r�r�s  �rZrfz1UrlParseTestCase.test_RFC2732.<locals>.<listcomp><r�r)zhttp://::12.34.56.78]/zhttp://[::1/foo/zftp://[::1/foo/bad]/badzhttp://[::1/foo/bad]/badzhttp://[::ffff:12.34.56.78c�8�g|]}|�d����Sr�r�r�s  rZrfz1UrlParseTestCase.test_RFC2732.<locals>.<listcomp>Gr�r)r?r@rArBrMrN�assertRaises�
ValueError)	rQr�r�rRrMrN�	urlparsed�invalid_urlr�s	        @rZ�test_RFC2732zUrlParseTestCase.test_RFC2732s������	�@	D�	D�	D�5�5�5�5�9�5�5�5��#,�{�#:�	V�	V��C��4���-�-�c�2�2�I����i�0�)�.�A�X�t�DT�U�U�U�U�.�.�.�	�=�<�)�<�<�<��$�{�2�	N�	N�K����j�&�,�*?��M�M�M�M�	N�	Nrc���ddddddddtd	d
ftd	dfg
}d���fd
�|D��}||zD]�\}}}tj�|��}|�|���|��|�|||f��|�|j|��|�|j|����dS)N)zhttp://python.org#frag�http://python.org�frag)rCrCr)zhttp://python.org/#frag�http://python.org/rD)rErEr)zhttp://python.org/?q#frag�http://python.org/?qrD)rFrFr)zhttp://python.org/p#fragzhttp://python.org/prD)�http://python.org/p?qrGrrr�rc�F�t|��d�|D����S)Nc3�@K�|]}|�d��V��dSr�r�r�s  rZr�zCUrlParseTestCase.test_urldefrag.<locals>._encode.<locals>.<genexpr>Ys.����8�8��1�8�8�G�,�,�8�8�8�8�8�8r)�typer�s rZr�z0UrlParseTestCase.test_urldefrag.<locals>._encodeXs'���4��7�7�8�8�a�8�8�8�8�8�8rc�&��g|]
}�|����Sr�r�r�s  �rZrfz3UrlParseTestCase.test_urldefrag.<locals>.<listcomp>Zr�r)	rr#r?r@�	urldefragrBrJrRrH)rQr�r�rR�defragrDrVr�s       @rZ�test_urldefragzUrlParseTestCase.test_urldefragKs���C�:�E�<�I�@�G�B�
�/��5�
�/��4�
�	�	9�	9�	9�5�5�5�5�9�5�5�5��!*�[�!8�	4�	4��C����\�+�+�C�0�0�F����V�]�]�_�_�c�2�2�2����V�f�d�^�4�4�4����V�Z��0�0�0����V�_�d�3�3�3�3�	4�	4rc�Z�tj�d��}|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��dS)Nz,http://[FE80::822a:a8ff:fe49:470c%tESt]:1234zfe80::822a:a8ff:fe49:470c%tEStz%[FE80::822a:a8ff:fe49:470c%tESt]:1234s,http://[FE80::822a:a8ff:fe49:470c%tESt]:1234sfe80::822a:a8ff:fe49:470c%tESts%[FE80::822a:a8ff:fe49:470c%tESt]:1234)r?r@rOrBrMrD)rQr�s  rZ�test_urlsplit_scoped_IPv6z*UrlParseTestCase.test_urlsplit_scoped_IPv6bs����L�!�!�"P�Q�Q�������%E�F�F�F������#J�K�K�K��L�!�!�"Q�R�R�������%F�G�G�G������#K�L�L�L�L�Lrc���d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|jd��|�|�
��dd�|dd���d	}tj�|��}|�|jd��|�|jd
��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d
��|�|jd��|�|jd��|�|�
��|��d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d
��|�|jd��|�|jd��|�|�
��|��d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|jd��|�|�
��dd�|dd���d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|jd��|�|�
��|��d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d ��|�|j
d��|�|jd��|�|jd��|�|�
��|��d!}tj�|��}|�td"��5|jddd��dS#1swxYwYdS)#NzHTTP://WWW.PYTHON.ORG/doc/#fragr�zWWW.PYTHON.ORG�/doc/rrDr���7http://User:Pass@www.python.org:080/doc/?query=yes#frag�User:Pass@www.python.org:080�	query=yes�User�Pass�PzChttp://User@example.com:Pass@www.python.org:080/doc/?query=yes#frag�(User@example.com:Pass@www.python.org:080zUser@example.comsHTTP://WWW.PYTHON.ORG/doc/#fragr�sWWW.PYTHON.ORG�/doc/r�frag�www.python.orgs7http://User:Pass@www.python.org:080/doc/?query=yes#frag�User:Pass@www.python.org:080�	query=yes�User�PasssChttp://User@example.com:Pass@www.python.org:080/doc/?query=yes#frags(User@example.com:Pass@www.python.org:080sUser@example.coms%HTTP://WWW.PYTHON.ORG:65536/doc/#fragzout of range)r?r@rOrBrCrDrErGrHrKrLrMrNrJ�assertRaisesRegexr>)rQrRr�s   rZ�test_urlsplit_attributesz)UrlParseTestCase.test_urlsplit_attributesks4��/���L�!�!�#�&�&�������6�*�*�*������#3�4�4�4�������)�)�)������"�%�%�%������V�,�,�,������T�*�*�*������T�*�*�*������%5�6�6�6�������&�&�&�	
��������A�B�B���Q�R�R��1�1�1�G���L�!�!�#�&�&�������6�*�*�*������#A�B�B�B�������)�)�)������+�.�.�.������V�,�,�,������V�,�,�,������V�,�,�,������%5�6�6�6�������$�$�$���������S�)�)�)�T���L�!�!�#�&�&�������6�*�*�*������#M�N�N�N�������)�)�)������+�.�.�.������V�,�,�,������%7�8�8�8������V�,�,�,������%5�6�6�6�������$�$�$���������S�)�)�)�1���L�!�!�#�&�&�������7�+�+�+������#4�5�5�5�������*�*�*������#�&�&�&������W�-�-�-������T�*�*�*������T�*�*�*������%6�7�7�7�������&�&�&���������A�B�B���Q�R�R��1�1�1�H���L�!�!�#�&�&�������7�+�+�+������#B�C�C�C�������*�*�*������,�/�/�/������W�-�-�-������W�-�-�-������W�-�-�-������%6�7�7�7�������$�$�$���������S�)�)�)�T���L�!�!�#�&�&�������7�+�+�+������#N�O�O�O�������*�*�*������,�/�/�/������W�-�-�-������%8�9�9�9������W�-�-�-������%6�7�7�7�������$�$�$���������S�)�)�)�7���L�!�!�#�&�&��
�
#�
#�J��
?�
?�	�	�
�F�F�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�_�_�!_c���d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|jd��|�|�
��d��d}tj�|��}|�|jd	��|�|jd
��|�|jd��|�|jd��|�|jd
��|�|j	d��|�|j
d��|�|jd
��|�|jd��|�|�
��d��d}d}td��D]f}tj�||���}|�|jd��|�|�
��d���gdS)NzQhttp	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr�r�z/javascript:alert('msg')/zquery=somethingrHzGhttp://www.python.org/javascript:alert('msg')/?query=something#fragmentsQhttp	://www.python
.org	/java
script:	alert('msg
')/?query
=	something#frag
mentr�r]s/javascript:alert('msg')/squery=something�fragmentsGhttp://www.python.org/javascript:alert('msg')/?query=something#fragmentzNhttp://www.python.org/java
script:	alert('msg
')/?query
=	something#frag
mentzht
tpr��rC)r?r@rOrBrCrDrErGrHrKrLrMrNrJ�range)rQrRr�rC�_s     rZ�!test_urlsplit_remove_unsafe_bytesz2UrlParseTestCase.test_urlsplit_remove_unsafe_bytes�s���k���L�!�!�#�&�&�������6�*�*�*������#3�4�4�4������!<�=�=�=������"3�4�4�4������Z�0�0�0������T�*�*�*������T�*�*�*������%5�6�6�6�������&�&�&���������%n�o�o�o�m���L�!�!�#�&�&�������7�+�+�+������#4�5�5�5������!=�>�>�>������"4�5�5�5������[�1�1�1������T�*�*�*������T�*�*�*������%6�7�7�7�������&�&�&���������%o�p�p�p�f�����q���	t�	t�A���%�%�c�&�%�9�9�A����Q�X�v�.�.�.����Q�X�X�Z�Z�)r�s�s�s�s�	t�	trc�n	�ttdd����}d}|�d��|z}tj�|��}|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd	��|�|jd
��|�|j
d��|�|jd��|�|jd
��|�|���|��||�d��z}tj�|��}|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|jd��|�|j
d��|�|jd��|�|jd
��|�|���|�d����d}tj�|�d��|z��}|�|jd��|�|jd��|�|j	d��|�|j
d��|�|jd��|�|���|��tj�d��}|�tj�|��d��d}|�d��dz|�d��z}td��D]f}tj�||���}|�|jd��|�|���d���gdS) Nr�!rT�utf-8r�rUrRrVrDrWrXr�rYr�r^r[r_r\r`rar]z)https://www.python.org:88/doc/?query=    r�zwww.python.org:88z
query=    �Xz
www.pypi.org z//www.python.org/r�rfzhttps://www.python.org/)�bytesrg�decoder?r@rOrBrCrDrErGrHrKrLrMrNrJr�rP)rQ�noise�base_urlrRr��query_spaces_urlrCrhs        rZ�test_urlsplit_strip_urlz(UrlParseTestCase.test_urlsplit_strip_url�s���e�A�x�(�(�)�)��L���l�l�7�#�#�h�.���L�!�!�#�&�&�������6�*�*�*������#A�B�B�B�������)�)�)������+�.�.�.������V�,�,�,������V�,�,�,������V�,�,�,������%5�6�6�6�������$�$�$���������X�.�.�.��h�o�o�g�.�.�.���L�!�!�#�&�&�������7�+�+�+������#B�C�C�C�������*�*�*������,�/�/�/������W�-�-�-������W�-�-�-������W�-�-�-������%6�7�7�7�������$�$�$���������X�_�_�W�%=�%=�>�>�>�G���L�!�!�%�,�,�w�"7�"7�:J�"J�K�K�������7�+�+�+������#6�7�7�7�������)�)�)������,�/�/�/�������$�$�$���������%5�6�6�6��L�!�!�/�2�2��	
�����0�0��3�3�_�E�E�E�"�����g�&�&��0�5�<�<��3H�3H�H���q���	D�	D�A���%�%�c�&�%�9�9�A����Q�X�w�/�/�/����Q�X�X�Z�Z�)B�C�C�C�C�	D�	Drc
�l�dD�]/}tjjtjjfD�]}dD�]}|�|||���5d|z}d|zdz}|r`|���r?|���r+|�d��}|�d��}n
	ddd����||��}|�|j|��|�	t��5|jddd��n#1swxYwYddd��n#1swxYwY����
��1dS)	z Check handling of invalid ports.�FT)	r-z1.5z-1�0x10z-0�1_1z 1z1 u६)rnr@rNzwww.example.net:zhttp://r�r�N)r?r@rOrA�subTest�isasciir�rBrDr=r>rN)rQrnr@rNrDrRr�s       rZ�test_attributes_bad_portz)UrlParseTestCase.test_attributes_bad_port(s���"�	#�	#�E� �,�/���1F�G�
#�
#��X�
#�
#�D����E��T��J�J�#�#�!3�d�!:��'�&�0�3�6�� �)�%�~�~�/�/�)�D�L�L�N�N�)�)/���w�)?�)?��&)�j�j��&9�&9��� (�#�#�#�#�#�#�#�"�E�#�J�J���(�(���6�:�:�:�!�.�.�z�:�:�#�#��F�F�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#��
#�
#�	#�	#s>�A$D#	�8AD#	�8D�D#	�D�D#	�D�D#	�#D'
�*D'
c	���dD]�}tjjtjjfD]�}dD]�}|�|||���5|dz}|r7|���r|�d��}n
	ddd���Y||��}|r|�|jd��n|�|jd��ddd��n#1swxYwY������dS)	z"Check handling of invalid schemes.ru)r��+�-�0zhttp&u६http)rnr@rCz://www.example.netr�Nrr)	r?r@rOrArxryr�rBrC)rQrnr@rCrRr�s      rZ�test_attributes_bad_schemez+UrlParseTestCase.test_attributes_bad_scheme;sf��"�	;�	;�E� �,�/���1F�G�

;�

;��F�;�;�F����E��v��N�N�;�;�$�';�;�� �)�"�{�{�}�}�)�&)�j�j��&9�&9��� (�
;�;�;�;�;�;�;�"�E�#�J�J�� �;� �,�,�Q�X�s�;�;�;�;� �,�,�Q�X�r�:�:�:�;�;�;�;�;�;�;�;�;�;�;����;�;�;�;��;�

;�	;�	;s�3C	�AC	�C
�C
c�~�d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|�	��|��tj�
|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|�	��|��d}tj�|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|�	��|��tj�
|��}|�|jd��|�|jd��|�|jd��|�|jd��|�|jd��|�|�	��|��dS)Nz0sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15rs0sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15r)r?r@rOrBrDrKrLrMrNrJrA)rQ�urir�s   rZ�test_attributes_without_netlocz/UrlParseTestCase.test_attributes_without_netlocMs���A���L�!�!�#�&�&�������2�&�&�&������T�*�*�*������T�*�*�*������T�*�*�*�������&�&�&���������S�)�)�)��L�!�!�#�&�&�������2�&�&�&������T�*�*�*������T�*�*�*������T�*�*�*�������&�&�&���������S�)�)�)�B���L�!�!�#�&�&�������3�'�'�'������T�*�*�*������T�*�*�*������T�*�*�*�������&�&�&���������S�)�)�)��L�!�!�#�&�&�������3�'�'�'������T�*�*�*������T�*�*�*������T�*�*�*�������&�&�&���������S�)�)�)�)�)rc���|�tj�d��d��|�tj�d��d��dS)Nz http://example.com?blahblah=/foo)r�zexample.comrrz
blahblah=/foors http://example.com?blahblah=/foo)r�sexample.comrrs
blahblah=/foorrrs rZ�test_noslashzUrlParseTestCase.test_noslashvsp�������.�.�/Q�R�R�M�	O�	O�	O������.�.�/R�S�S�S�	U�	U�	U�	U�	Urc�j�|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d	��d
��|�tj�d��d��dS)
NrE)rrrErrrz//www.python.org:80)r�www.python.org:80rrrr�http://www.python.org:80�r�r�rrrr�path)rrr�rrrs//www.python.org:80)r�www.python.org:80rrrr�http://www.python.org:80�r�r�rrrrrrs rZ�test_withoutschemez#UrlParseTestCase.test_withoutscheme}s'��
	
�����.�.�v�6�6�'�	)�	)�	)������.�.�/D�E�E�4�	6�	6�	6������.�.�/I�J�J�8�	:�	:�	:�	
�����.�.�w�7�7�-�	/�	/�	/������.�.�/E�F�F�:�	<�	<�	<������.�.�/J�K�K�>�	@�	@�	@�	@�	@rc���|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d	��d
��|�tj�d��d��|�tj�d
��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��dS)Nzhttp:80)r�r�80rrrzhttps:80)r�rr�rrrzpath:80)rErr�rrrr+)r�rrrrrzhttps:)r�rrrrrr�r�shttp:80)r�r�80rrrshttps:80)r�rr�rrrspath:80)r�rr�rrrshttp:)r�rrrrrshttps:)r�rrrrrr�r�rrs rZ�test_portseparatorz#UrlParseTestCase.test_portseparator�s��������.�.�y�9�9�;T�U�U�U������.�.�z�:�:�<V�W�W�W������.�.�y�9�9�;T�U�U�U������.�.�w�7�7�8O�P�P�P������.�.�x�8�8�9Q�R�R�R������.�.�/I�J�J�8�	:�	:�	:�	
�����.�.�z�:�:�<[�\�\�\������.�.�{�;�;�=]�^�^�^������.�.�z�:�:�<[�\�\�\������.�.�x�8�8�9V�W�W�W������.�.�y�9�9�:X�Y�Y�Y������.�.�/J�K�K�>�	@�	@�	@�	@�	@rc�\�|�ttjjd��dS)Nr-)r=�	TypeErrorr?r@�	urlencoders rZ�
test_usingsyszUrlParseTestCase.test_usingsys�s%�����)�V�\�%;�U�C�C�C�C�Crc�6�|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d��d��|�tj�d	��d
��|�tj�d��d��|�tj�d
��d��|�tj�d��d��dS)Nzs3://foo.com/stuff)�s3�foo.com�/stuffrrrr�)�x-newschemer�r�rrrz*x-newscheme://foo.com/stuff?query#fragment)r�r�r�rrGrHz!x-newscheme://foo.com/stuff?query)r�r�r�rrGrss3://foo.com/stuff)ss3�foo.com�/stuffrrrsx-newscheme://foo.com/stuff)�x-newschemer�r�rrrs*x-newscheme://foo.com/stuff?query#fragment)r�r�r�r�queryres!x-newscheme://foo.com/stuff?query)r�r�r�rr�rrrs rZ�test_anyschemezUrlParseTestCase.test_anyscheme�s��������.�.�/C�D�D�@�	B�	B�	B������.�.�/L�M�M�I�	K�	K�	K������.�.�/[�\�\�V�	X�	X�	X������.�.�/R�S�S�N�	P�	P�	P�	
�����.�.�/D�E�E�F�	H�	H�	H������.�.�/M�N�N�O�	Q�	Q�	Q������.�.�/\�]�]�\�	^�	^�	^������.�.�/S�T�T�T�	V�	V�	V�	V�	Vrc��tjjtjjfD�]]}|�|���5|dd��}|�|jd��|dd��}|�|jd��|�|dd��jd��|�|dd�	��jd��|�|d
d�	��jd��|�|d��jd��|�|d
��jd��|�|d
d��jd��ddd��n#1swxYwY��_dS)
N)�functionzhttp://example.net/�ftpr�shttp://example.net/sftpr�rErfr�rr)r?r@rArOrxrBrC)rQ�funcrVs   rZ�test_default_schemez$UrlParseTestCase.test_default_scheme�s����\�*�F�L�,A�B�	@�	@�D����t��,�,�

@�

@���3�U�;�;��� � ����7�7�7���4�f�=�=��� � ����8�8�8�� � ���f�e�!4�!4�!;�U�C�C�C�� � ���f�U�!;�!;�!;�!B�E�J�J�J�� � ���g�f�!=�!=�!=�!D�f�M�M�M�� � ���f���!4�b�9�9�9�� � ���g���!5�s�;�;�;�� � ���g�r�!2�!2�!9�3�?�?�?�

@�

@�

@�

@�

@�

@�

@�

@�

@�

@�

@����

@�

@�

@�

@��	@�	@s�D-E5�5E9	�<E9	c
�`�d}|D�]�\}}}tjjtjjfD�]|}|dkr|tjjurd}|�||���5||d���}|�|jd��|�t||���	d|z����|�||dd��jd��||d	���}|�|j|��|�
t||���	|����|�||dd	��j|��|�||��j|��ddd��n#1swxYwY��~���dS)
N)
)z
http:#fragrErD)z//example.net#fragrErD)zindex.html#fragrErD)z	;a=b#fragrFrD)z	?a=b#fragrGrD)z#fragrErD)z	abc#@fragrE�@frag)z//abc#@fragrEr�)z//abc:80#@fragrEr�)z//abc#@frag:80rEz@frag:80rFrE)rRr�F)�allow_fragmentsr�#T)r?r@rArOrxrBrH�
assertTrue�getattr�endswith�assertFalse)rQ�testsrR�attr�
expected_fragr�rVs       rZ�test_parse_fragmentsz%UrlParseTestCase.test_parse_fragments�s.��
��).�	H�	H�$�C��}���.���0E�F�
H�
H���8�#�#����0E�(E�(E�!�D��\�\�c�D�\�9�9�
H�
H�!�T�#�u�=�=�=�F��$�$�V�_�b�9�9�9��O�O�#�F�D�1�1�:�:�3��;N�O�O�Q�Q�Q��$�$�T�T�#�r�5�%9�%9�%B�B�G�G�G�!�T�#�t�<�<�<�F��$�$�V�_�m�D�D�D��$�$�#�F�D�1�1�:�:�=�I�I�K�K�K��$�$�T�T�#�r�4�%8�%8�%A�%2�4�4�4��$�$�T�T�#�Y�Y�%7��G�G�G�
H�
H�
H�
H�
H�
H�
H�
H�
H�
H�
H����
H�
H�
H�
H��
H�	H�	Hs�#D0F�F#�&F#c�|�|�td��5tj�dd��ddd��n#1swxYwY|�td��5tj�dd��ddd��n#1swxYwY|�td��5tj�dd��ddd��n#1swxYwY|�td��5tj�dd��ddd��n#1swxYwY|�td��5tj�d��ddd��n#1swxYwY|�td��5tj�d��ddd��n#1swxYwY|�td��5tj�d��ddd��n#1swxYwY|�td��5tj�d	��ddd��n#1swxYwY|�td��5tj�d
d��ddd��n#1swxYwY|�td��5tj�dd
��ddd��dS#1swxYwYdS)NzCannot mix strr�r�r]r�)r�r�rrrr)r�r]rrrr)r�r�rrr)r�r]rrrrCshttp://python.org)	rbr�r?r@rArOrIrPr�rs rZ�test_mixed_types_rejectedz*UrlParseTestCase.test_mixed_types_rejected�s����
#�
#�I�/?�
@�
@�	=�	=��L�!�!�"2�G�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�
�
#�
#�I�/?�
@�
@�	=�	=��L�!�!�"3�V�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�
�
#�
#�I�/?�
@�
@�	=�	=��L�!�!�"2�G�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�
�
#�
#�I�/?�
@�
@�	=�	=��L�!�!�"3�V�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�
�
#�
#�I�/?�
@�
@�	N�	N��L�#�#�$L�M�M�M�	N�	N�	N�	N�	N�	N�	N�	N�	N�	N�	N����	N�	N�	N�	N�
�
#�
#�I�/?�
@�
@�	M�	M��L�#�#�$K�L�L�L�	M�	M�	M�	M�	M�	M�	M�	M�	M�	M�	M����	M�	M�	M�	M�
�
#�
#�I�/?�
@�
@�	J�	J��L�#�#�$H�I�I�I�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�
�
#�
#�I�/?�
@�
@�	J�	J��L�#�#�$H�I�I�I�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�
�
#�
#�I�/?�
@�
@�	L�	L��L� � �!4�6J�K�K�K�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L����	L�	L�	L�	L�
�
#�
#�I�/?�
@�
@�	L�	L��L� � �!5�7J�K�K�K�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L����	L�	L�	L�	L�	L�	Ls��!A	�	A
�A
�/!B�B �#B �!C/�/C3�6C3�!E�E�	E�( F�F�F�: G&�&G*�-G*� H8�8H<�?H<� J
�
J�J�0!K�K!�$K!�!L1�1L5�8L5c���t|j��}|j}|�|j|��d|z}d|z}||�}||�}d}d}	|�||��|�|���|��|�|���|��|�|�|��|��|�|�|��|��|�|�||	��|��|�|�||	��|��|�||��|�|���|��|�|���|��|�|�|��|��|�|�|��|��|�|�||	��|��|�|�||	��|��dS)N)r)rr��strict)rc�_fields�_encoded_counterpart�assertIs�_decoded_counterpartrBror�)
rQ�str_type�num_args�
bytes_type�str_args�
bytes_args�
str_result�bytes_result�encoding�errorss
          rZ�_check_result_typez#UrlParseTestCase._check_result_typesI���x�'�(�(���2�
��
�
�j�5�x�@�@�@��8�#���h�&�
��X�x�(�
�!�z�:�.����������X�.�.�.�����,�,�.�.��9�9�9�����,�,�.�.�
�;�;�;�����,�,�X�6�6��A�A�A�����,�,�X�6�6�
�C�C�C�����,�,�X�v�>�>��I�I�I�����,�,�X�v�>�>�
�K�K�K�����z�2�2�2�����*�*�,�,�j�9�9�9�����*�*�,�,�l�;�;�;�����*�*�8�4�4�j�A�A�A�����*�*�8�4�4�l�C�C�C�����*�*�8�V�<�<�j�I�I�I�����*�*�8�V�<�<�l�K�K�K�K�Krc��tjjtjjtjjg}|D]}|�|���dSr>)r?r@�DefragResult�SplitResult�ParseResultr�)rQ�result_types�result_types   rZ�test_result_pairsz"UrlParseTestCase.test_result_pairssU���,�
#�
�,�
"�
�,�
"�
��
(�	1�	1�K��#�#�K�0�0�0�0�	1�	1rc�L�tj�dd���}|�|ddgi��tj�dd���}|�|ddgi��tj�dd���}|�|dd	gi��tj�d
d���}|�|ddgi��tj�d
dd�
��}|�|ddgi��dS)N�	key=Ł%E9�latin-1�r��key�Łé�key=Ł%C3%A9rlr��Ł���
key=Ł%E9-�Ł�-�ignore�r�r��Ł-)r?r@rqrB�rQrVs  rZ�test_parse_qs_encodingz'UrlParseTestCase.test_parse_qs_encoding&s-����&�&���&�K�K������%�,��!8�9�9�9���&�&�'9�G�&�L�L������%�,��!8�9�9�9���&�&�'9�G�&�L�L������%�*>�)?�!@�A�A�A���&�&�'7�'�&�J�J������%�/�):�!;�<�<�<���&�&�'7�'�AI�'�K�K������%�)��!5�6�6�6�6�6rc�8�tj�dd���}|�|dg��tj�dd���}|�|dg��tj�dd���}|�|dg��tj�d	d���}|�|d
g��tj�d	dd���}|�|d
g��dS)Nr�r�r�)r�r�r�rlr�)r�r�r�)r�r�r�r�)r�r�)r?r@rhrBr�s  rZ�test_parse_qsl_encodingz(UrlParseTestCase.test_parse_qsl_encoding3s����'�'��)�'�L�L������"7�!8�9�9�9���'�'�(:�W�'�M�M������"7�!8�9�9�9���'�'�(:�W�'�M�M������"?�!@�A�A�A���'�'�(8�7�'�K�K������":�!;�<�<�<���'�'�(8�7�AI�(�K�K������"4�!5�6�6�6�6�6rc�J�|�t��5tj�d�dgdz��d���ddd��n#1swxYwYtj�d�dgdz��d���dS)Nrza=a��
)�max_num_fields)r=r>r?r@rh�joinrs rZ�test_parse_qsl_max_num_fieldsz.UrlParseTestCase.test_parse_qsl_max_num_fields@s���
�
�
�z�
*�
*�	L�	L��L�"�"�3�8�8�U�G�B�J�#7�#7��"�K�K�K�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L�	L����	L�	L�	L�	L�����s�x�x����
�3�3�B��G�G�G�G�Gs�9A � A$�'A$c
���difdifdddgifddgdgd	�fd
dddgifd
ifdifdddgifddgdgd�fddddgifg
}|D]�\}}|�d|�d|����5tj�|d���}|�||d|z��tj�|d
���}|�||d|z��ddd��n#1swxYwY��dS)N�;�;;r,r	rr.rrr
�a=1;a=2rr�;�;;r0rr!r2r%r'r �a=1;a=2r)r+�
Original: �, Expected: ��	separatorr_)rxr?r@rqrB)rQ�parse_qs_semicolon_casesrirjrV�result_bytess      rZ�test_parse_qs_separatorz(UrlParseTestCase.test_parse_qs_separatorEs���
�"�I�
�2�J�
�c�C�5�\�"�
�5�'���8�8�9�
��s�C�j�)�*�
�2�J�
�B�K�
�t�d�V�n�%�
�V�H�V�H�=�=�>�
�$��t��-�.�$
� �5�	R�	R�L�D�&����I�4�I�I�v�I�I�J�J�
R�
R���.�.�t�s�.�C�C��� � ���1C�d�1J�K�K�K�%�|�4�4�T�T�4�J�J��� � ��v�7I�D�7P�Q�Q�Q�	
R�
R�
R�
R�
R�
R�
R�
R�
R�
R�
R����
R�
R�
R�
R��	R�	Rs�A7C�C"	�%C"	c��dgfdgfddgfdddgfdd	d
gfdgfdgfd
dgfdddgfdddgfg
}|D]�\}}|�d|�d|����5tj�|d���}|�||d|z��tj�|d���}|�||d|z��ddd��n#1swxYwY��dS)Nr�r�r,r
r.rrr�rrr�r�r0r r2r$r&r�r(r*r�r�r�r_)rxr?r@rhrB)rQ�parse_qsl_semicolon_casesrirjrVr�s      rZ�test_parse_qsl_separatorz)UrlParseTestCase.test_parse_qsl_separatorZs���
�"�I�
�2�J�
�j�\�"�
�\�<�8�9�
��Z�0�1�
�2�J�
�B�K�
�|�n�%�
�n�n�=�>�
�,��5�6�%
�!�6�	R�	R�L�D�&����I�4�I�I�v�I�I�J�J�
R�
R���/�/���/�D�D��� � ���1C�d�1J�K�K�K�%�|�5�5�d�d�5�K�K��� � ��v�7I�D�7P�Q�Q�Q�	
R�
R�
R�
R�
R�
R�
R�
R�
R�
R�
R����
R�
R�
R�
R��	R�	Rs�
A7C�C	�C	c�r�|�tj�d��dg��|�tj�t	d����dg��|�tj�td����dg��dS)Nrr )rBr?r@rh�	bytearray�
memoryviewrs rZ�test_parse_qsl_bytesz%UrlParseTestCase.test_parse_qsl_bytesns��������/�/��7�7�,��H�H�H������/�/�	�&�0A�0A�B�B�\�N�S�S�S������/�/�
�6�0B�0B�C�C�l�^�T�T�T�T�Trc
��tdd���}dddddgitd��fD]Z}|�tjj|fi|��g��|�ttjj|d����[dS)	NT)r^�strict_parsingrrr�rar�)�dictr�rBr?r@rhr=r>)rQ�kwargsr�s   rZ�test_parse_qsl_false_valuez+UrlParseTestCase.test_parse_qsl_false_valuess�����T�B�B�B���S�$��3��B�
�3���?�	R�	R�A����V�\�3�A�@�@��@�@�"�E�E�E����j�&�,�*@�!�q��Q�Q�Q�Q�	R�	Rrc��|�ttjjtd����|�ttjjt
d����|�ttjjd��|�ttjjt����dD]U}|�t��5tj�d|���ddd��n#1swxYwY�V|�t��5tj�dd���ddd��n#1swxYwY|�t��5tj�dd���ddd��dS#1swxYwYdS)Nrra)rrNrrar�g�?rr��¦��)r=r�r?r@rh�list�iter�objectr>�UnicodeEncodeError�UnicodeDecodeError)rQr�s  rZ�test_parse_qsl_errorsz&UrlParseTestCase.test_parse_qsl_errorsysF�����)�V�\�%;�T�&�\�\�J�J�J����)�V�\�%;�T�&�\�\�J�J�J����)�V�\�%;�Q�?�?�?����)�V�\�%;�V�X�X�F�F�F�6�	C�	C�I��"�"�:�.�.�
C�
C���&�&�u�	�&�B�B�B�
C�
C�
C�
C�
C�
C�
C�
C�
C�
C�
C����
C�
C�
C�
C��
�
�
�1�
2�
2�	=�	=��L�"�"�6�V�"�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�
�
�
�1�
2�
2�	=�	=��L�"�"�5�G�"�<�<�<�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�	=�	=s6�1"D�D#	�&D#	�"E3�3E7�:E7�"G�G�Gc�>�tj�ddgdd�d��}t|�d����hd�ksJ�Gd�d	��}tj�d
|��id��}|�|d��dS)Nrar�)r�rS�r
Tr>�a=1�a=2�b=3�b=4�b=5c��eZdZd�ZdS)�:UrlParseTestCase.test_urlencode_sequences.<locals>.Trivialc��dS)N�trivialr�rs rZ�__str__zBUrlParseTestCase.test_urlencode_sequences.<locals>.Trivial.__str__�s�� �yrN)�__name__�
__module__�__qualname__rr�rrZ�Trivialr
�s#������
!�
!�
!�
!�
!rrr	z	a=trivial)r?r@r��setrTrB)rQrVrs   rZ�test_urlencode_sequencesz)UrlParseTestCase.test_urlencode_sequences�s�����'�'�q�!�f�9�(E�(E�t�L�L���6�<�<��$�$�%�%�)L�)L�)L�L�L�L�L�	!�	!�	!�	!�	!�	!�	!�	!���'�'��g�g�i�i�(8�$�?�?�������-�-�-�-�-rc��tj�ddi��}|�|d��tj�dditjj���}|�|d��tj�ddidtjj���}|�|d	��dS)
Nr	z
some valueza=some+valuezsome value/another)�	quote_viaza=some%20value%2Fanotherr�)�saferza=some%20value/another)r?r@r�rB�quoter�s  rZ�test_urlencode_quote_viaz)UrlParseTestCase.test_urlencode_quote_via�s�����'�'��l�(;�<�<�������0�0�0���'�'��.B�(C�28�,�2D�(�F�F������!;�<�<�<���'�'��.B�(C�-0�F�L�<N�(�P�P������!9�:�:�:�:�:rc�0�|�ttjjd��tj�d��}|�|d��tj�d��}|�|d��dS)Nr-sarchaeological arcanazarchaeological%20arcanarr)r=r�r?r@�quote_from_bytesrBr�s  rZ�test_quote_from_bytesz&UrlParseTestCase.test_quote_from_bytes�s}�����)�V�\�%B�E�J�J�J���.�.�/G�H�H������!:�;�;�;���.�.�s�3�3�������$�$�$�$�$rc���tj�d��}|�|d��tj�d��}|�|d��dS)Nz	abc%20defsabc defrr)r?r@�unquote_to_bytesrBr�s  rZ�test_unquote_to_bytesz&UrlParseTestCase.test_unquote_to_bytes�s^����.�.�{�;�;�������,�,�,���.�.�r�2�2�������%�%�%�%�%rc��|�ttjjdd���|�ttjjdd���dS)Nsfoorlr�r�)r�)r=r�r?r@rrs rZ�test_quote_errorsz"UrlParseTestCase.test_quote_errors�sU�����)�V�\�%7��#*�	�	,�	,�	,����)�V�\�%7����Q�Q�Q�Q�Qrc��tj�d��}|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��dS)Nztel:+31-641044153�telz
+31-641044153ztel:+31641044153z+31641044153)r?r@rOrBrCrErA)rQ�p1�p2s   rZ�test_issue14072z UrlParseTestCase.test_issue14072�s ��
�\�
"�
"�#6�
7�
7�������E�*�*�*������/�2�2�2�
�\�
"�
"�#5�
6�
6�������E�*�*�*������.�1�1�1�
�\�
"�
"�#6�
7�
7�������E�*�*�*������/�2�2�2�
�\�
"�
"�#5�
6�
6�������E�*�*�*������.�1�1�1�1�1rc�b�|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd��|�ttjjd	��|�ttjjd
��dS)Nz&Scheme://user@[192.0.2.146]/Path?Queryz-Scheme://user@[important.com:8000]/Path?Queryz#Scheme://user@[v123r.IP]/Path?Queryz Scheme://user@[v12ae]/Path?QueryzScheme://user@[v.IP]/Path?Queryz Scheme://user@[v123.]/Path?QueryzScheme://user@[v]/Path?Queryz5Scheme://user@[0439:23af::2309::fae7:1234]/Path?QueryzJScheme://user@[0439:23af:2309::fae7:1234:2342:438e:192.0.2.146]/Path?QueryzScheme://user@]v6a.ip[/Path)r=r>r?r@rOrs rZ�test_invalid_bracketed_hostsz-UrlParseTestCase.test_invalid_bracketed_hosts�s@�����*�f�l�&;�=e�f�f�f����*�f�l�&;�=l�m�m�m����*�f�l�&;�=b�c�c�c����*�f�l�&;�=_�`�`�`����*�f�l�&;�=^�_�_�_����*�f�l�&;�=_�`�`�`����*�f�l�&;�=[�\�\�\����*�f�l�&;�=t�u�u�u����*�f�l�&;�>J�	K�	K�	K����*�f�l�&;�=Z�[�[�[�[�[rc��tj�d��}|�|jd��|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��|�|jd��dS)	Nz!scheme://user@[v6a.ip]/path?queryzv6a.ip�user�/pathz4scheme://user@[0439:23af:2309::fae7%test]/path?queryz0439:23af:2309::fae7%testzEscheme://user@[0439:23af:2309::fae7:1234:192.0.2.146%test]/path?queryz*0439:23af:2309::fae7:1234:192.0.2.146%test)r?r@rOrBrMrKrE)rQr&r'�p3s    rZ�test_splitting_bracketed_hostsz/UrlParseTestCase.test_splitting_bracketed_hosts�s$��
�\�
"�
"�#F�
G�
G�������h�/�/�/������f�-�-�-������'�*�*�*�
�\�
"�
"�#Y�
Z�
Z�������&A�B�B�B������f�-�-�-������'�*�*�*�
�\�
"�
"�#j�
k�
k�������&R�S�S�S������f�-�-�-������'�*�*�*�*�*rc�p�d}tj�d��}|�t|��5|jddd��n#1swxYwYtj�d��}|�t|��5|jddd��dS#1swxYwYdS)Nz3Port could not be cast to integer value as 'oracle'z%http://Server=sde; Service=sde:oracle)r?r@rArbr>rNrO)rQ�messager&r's    rZ�!test_port_casting_failure_messagez2UrlParseTestCase.test_port_casting_failure_message�s(��G��
�\�
"�
"�#J�
K�
K��
�
#�
#�J��
8�
8�	�	��G�G�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��\�
"�
"�#J�
K�
K��
�
#�
#�J��
8�
8�	�	��G�G�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s#�A�A�A�B+�+B/�2B/c��tj�d��}|�|jd��|�|jd��|�|jd��tj�d��}|�|jd��|�|jd��|�|jd��tj�d��}|�|jd��|�|jd	��|�|jd
��tj�d��}|�|jd��|�|jd��|�|jd
��dS)Nz"tel:123-4;phone-context=+1-650-516r%z123-4zphone-context=+1-650-516ztel:+1-201-555-0123z+1-201-555-0123rz"tel:7042;phone-context=example.com�7042zphone-context=example.comz%tel:863-1234;phone-context=+1-914-555z863-1234zphone-context=+1-914-555)r?r@rArBrCrErF)rQr&s  rZ�test_telurl_paramsz#UrlParseTestCase.test_telurl_params�s���
�\�
"�
"�#G�
H�
H�������E�*�*�*������'�*�*�*������$>�?�?�?�
�\�
"�
"�#8�
9�
9�������E�*�*�*������"3�4�4�4������B�'�'�'�
�\�
"�
"�#G�
H�
H�������E�*�*�*������&�)�)�)������$?�@�@�@�
�\�
"�
"�#J�
K�
K�������E�*�*�*������*�-�-�-������$>�?�?�?�?�?rc��tj�tjj��}|�dt|����dS)N�Quoter)r?r@�_Quoter�_ALWAYS_SAFE�assertIn�repr)rQ�quoters  rZ�test_Quoter_reprz!UrlParseTestCase.test_Quoter_repr�s<����%�%�f�l�&?�@�@���
�
�h��V���-�-�-�-�-rc�B�tj���dSr>)r?r@�clear_cachers rZ�"test_clear_cache_for_code_coveragez3UrlParseTestCase.test_clear_cache_for_code_coverage�s���� � �"�"�"�"�"rc��|�t��5tjj}ddd��dS#1swxYwYdS)z5Test that urllib.parse.__getattr__() fails correctly.N)r=�AttributeErrorr?r@�this_does_not_exist)rQ�unuseds  rZ�!test_urllib_parse_getattr_failurez2UrlParseTestCase.test_urllib_parse_getattr_failures���
�
�
�~�
.�
.�	6�	6��\�5�F�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s
�:�>�>c�P�g}hd�}ttj��D]`}|�d��s||vr�t	tj|��}t	|dd��dkr|�|���a|�tjj|��dS)N>�unwrap�splittag�to_bytes�	splitattr�	splithost�	splitport�	splittype�	splituser�
ResultBase�
splitnport�
splitquery�
splitvaluer?�splitpasswdrhrzurllib.parse)�dirr?r@�
startswithr��append�assertCountEqual�__all__)rQr��undocumented�namers     rZ�test_allzUrlParseTestCase.test_alls�����
�
�
�����%�%�	&�	&�D����s�#�#�
�t�|�';�';���V�\�4�0�0�F��v�|�T�2�2�n�D�D�����%�%�%�����f�l�2�H�=�=�=�=�=rc����d�d��D�����fd�tttdtj����D��}|�d|��|�d|��tj�d��|�	t��5tj�d��ddd��n#1swxYwYd	D]�}d
D]�}|D]�}d�||�|����}|�|d�t|�����
��5|�	t��5tj�|��ddd��n#1swxYwYddd��n#1swxYwY�̌ь�dS)Nz/:#?@c�R�h|]$}d�t|������%S)�{:04X})�format�ord)rdrs  rZ�	<setcomp>z?UrlParseTestCase.test_urlsplit_normalization.<locals>.<setcomp>s*��D�D�D��X�_�_�S��V�V�,�,�D�D�Drc���g|]R}tj|��r<�ttj|�������zr|�v�P|��SSr�)�unicodedata�
decompositionrrT)rdr�	hex_chars�
illegal_charss  ��rZrfz@UrlParseTestCase.test_urlsplit_normalization.<locals>.<listcomp>ss���
�
�
���(��+�+�
��S��!:�1�!=�!=�!C�!C�!E�!E�F�F�F�
���&�&�
�'�&�&r�u℀u#uhttp://プ:80uhttp://プ︓80)r�r�r�)znetloc{}false.netloczn{}user@netlocz{}://{}/pathr^)rR�char)�map�chrrg�sys�
maxunicoder:r?r@rOr=r>r_rxr`)rQ�denorm_charsrCrDrrRrerfs      @@rZ�test_urlsplit_normalizationz,UrlParseTestCase.test_urlsplit_normalizations����� �
�D�D�m�D�D�D�	�
�
�
�
�
��3��c�3�>� :� :�;�;�
�
�
��	
�
�
�h��-�-�-��
�
�h��-�-�-�	����6�7�7�7�
�
�
�z�
*�
*�	A�	A��L�!�!�"?�@�@�@�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A����	A�	A�	A�	A�/�	7�	7�F�D�
7�
7��%�7�7�A�(�/�/���
�
�a�8H�8H�I�I�C����#�H�O�O�C��F�F�4K�4K��L�L�7�7�!�.�.�z�:�:�7�7�"�L�1�1�#�6�6�6�7�7�7�7�7�7�7�7�7�7�7����7�7�7�7�7�7�7�7�7�7�7�7�7�7�7����7�7�7�7��7�
7�	7�	7sH�0 C�C �#C �F1	�. F�F1	�F�F1	�!F�"F1	�1F5
�8F5
r>):rrrr[rlrrr�r�r�r�r�rrr$r)r/rArNrPrcrirsrzrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr!r#r(r*r/r2r5r=r@rEr[rnr�rrZr<r<hs�������38�38�38�38�j7�7�7�7�7�7�?5�?5�?5�B;�;�;�@$=�$=�$=�LJ�J�J�S�S�S�"A�"A�"A�`@�@�@�
%J�%J�%J�Z7B�7B�7B�r5&�5&�5&�n0N�0N�0N�d4�4�4�.M�M�M�[�[�[�z#t�#t�#t�J9D�9D�9D�v#�#�#�&;�;�;�$'*�'*�'*�RU�U�U�@�@�@�&@�@�@�$D�D�D�V�V�V�*
@�
@�
@�H�H�H�BL�L�L�0L�L�L�21�1�1�7�7�7�7�7�7�H�H�H�
R�R�R�*R�R�R�(U�U�U�
R�R�R�=�=�=�.�.�.�;�;�;�%�%�%�&�&�&�R�R�R�

2�
2�
2�
\�
\�
\�+�+�+����@�@�@�*.�.�.�#�#�#�6�6�6�
>�>�>� 7�7�7�7�7rr<c�Z�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZdS)�
Utility_Testsz=Testcase to test the various utility functions in the urllib.c�^�tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��dS)Nztype:opaquestring)rJ�opaquestringrr)Nrr�
:opaquestring)Nrsztype:)rJrztype:opaque:string)rJz
opaque:string)r?r@�
_splittyperB)rQrMs  rZ�test_splittypezUtility_Tests.test_splittype7s����L�+�	������#6�7�7�9Q�R�R�R������>�2�2�4J�K�K�K������?�3�3�5L�M�M�M������7�+�+�\�:�:�:������#7�8�8�:S�T�T�T�T�Trc��tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��|�|d��d��|�|d
��d��|�|d��d��|�|d��d��|�|d��d��dS)Nz%//www.example.org:80/foo/bar/baz.html)�www.example.org:80�/foo/bar/baz.htmlz//www.example.org:80)rwrrx)Nrxz//127.0.0.1#@host.com)�	127.0.0.1�/#@host.comz//127.0.0.1#@host.com:80)ryz/#@host.com:80z//127.0.0.1:80#@host.com)z127.0.0.1:80rzz///file)rz/filez//example.net/file;)�example.netz/file;z//example.net/file?)r{z/file?z//example.net/file#)r{z/file#)r?r@�
_splithostrB)rQrKs  rZ�test_splithostzUtility_Tests.test_splithost?s����L�+�	������#J�K�K�D�	F�	F�	F������#9�:�:�3�	5�	5�	5������#6�7�7�4�	6�	6�	6�	
�����#:�;�;�5�	7�	7�	7������#=�>�>�8�	:�	:�	:������#=�>�>�8�	:�	:�	:�	
�����9�-�-�&�	(�	(�	(�	
�����#8�9�9�2�	4�	4�	4������#8�9�9�2�	4�	4�	4������#8�9�9�2�	4�	4�	4�	4�	4rc�^�tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��dS)NrU)�	User:Pass�www.python.org:080z@www.python.org:080)rr�r�)Nr�z
User:Pass@)rrrZ)zUser@example.com:Passr�)r?r@�
_splituserrB)rQrNs  rZ�test_splituserzUtility_Tests.test_splituser\s����L�+�	������#A�B�B�<�	>�	>�	>������#8�9�9�3�	5�	5�	5������#7�8�8�5�	7�	7�	7������<�0�0�*�	,�	,�	,������#M�N�N�H�	J�	J�	J�	J�	Jrc�N�tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��|�|d��d��|�|d
��d��|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d��d��dS)Nzuser:ab)r,�abzuser:a
b)r,za
bzuser:a	b)r,za	bzuser:a
b)r,za
bzuser:ab)r,zabzuser:ab)r,zabzuser:a:b)r,za:bzuser:a b)r,rz	user 2:ab)zuser 2r�z
user+1:a+b)zuser+1za+bzuser:)r,rr,)r,Nz:ab)rr�)r?r@�_splitpasswdrB)rQrSs  rZ�test_splitpasswdzUtility_Tests.test_splitpasswdis����l�/�������Y�/�/��@�@�@������[�1�1�3C�D�D�D������[�1�1�3C�D�D�D������[�1�1�3C�D�D�D������[�1�1�3C�D�D�D������[�1�1�3C�D�D�D������Z�0�0�/�B�B�B������Z�0�0�/�B�B�B������[�1�1�3C�D�D�D������\�2�2�4E�F�F�F������W�-�-�|�<�<�<������V�,�,�n�=�=�=������U�+�+�Z�8�8�8�8�8rc��tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d��d	��|�|d
��d��|�|d��d
��|�|d��d��dS)N�	parrot:88)�parrot�88r��r�N�parrot:ry)ryN�
parrot:cheese)r�Nz[::1]:88)�[::1]r�r�)r�Nz:88)rr�)r?r@�
_splitportrB)rQrLs  rZ�test_splitportzUtility_Tests.test_splitport{s���L�+�	������;�/�/�1A�B�B�B������8�,�,�.>�?�?�?������9�-�-�/?�@�@�@������;�/�/�1D�E�E�E������?�3�3�5L�M�M�M������:�.�.��@�@�@������7�+�+�_�=�=�=������5�)�)�:�6�6�6�6�6rc��tjj}|�|d��d��|�|d��d��|�|dd��d��|�|d��d��|�|dd��d��|�|d��d	��|�|dd��d
��|�|d��d��|�|dd��d��|�|d
��d��dS)Nr�)r�rmr�)r�����7)r�r�r�ry)ryr�)ryr�r�r�z
parrot: +1_0 )r?r@�_splitnportrB)rQrPs  rZ�test_splitnportzUtility_Tests.test_splitnport�s_���\�-�
������K�0�0�.�A�A�A������H�-�-�~�>�>�>������H�b�1�1�>�B�B�B������I�.�.��?�?�?������I�r�2�2�N�C�C�C������K�0�0�2C�D�D�D������K��4�4�6G�H�H�H������O�4�4�6F�G�G�G������O�R�8�8�:J�K�K�K������O�4�4�6F�G�G�G�G�Grc� �tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��dS)	N�http://python.org/fake?foo=bar)�http://python.org/fake�foo=barzhttp://python.org/fake?foo=bar?)r�rr�)r�Nz?foo=bar)rr�)r?r@�_splitqueryrB)rQrQs  rZ�test_splitqueryzUtility_Tests.test_splitquery�s����\�-�
������$D�E�E�>�	@�	@�	@������$E�F�F�?�	A�	A�	A������$<�=�=�9�	;�	;�	;������J�/�/��A�A�A�A�Arc�^�tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��dS)N�http://example.com?foo=bar#baz)�http://example.com?foo=bar�bazzhttp://example.com?foo=bar#)r�rz#baz)rr�r�)r�Nz"http://example.com?foo=bar#baz#boo)r��boo)r?r@�	_splittagrB)rQrHs  rZ�
test_splittagzUtility_Tests.test_splittag�s����<�)�������"B�C�C�>�	@�	@�	@������"?�@�@�;�	=�	=�	=������&�)�)�;�7�7�7������">�?�?�=�	?�	?�	?������"F�G�G�B�	D�	D�	D�	D�	Drc�:�tjj}|�|d��dddgf��|�|d��ddgf��|�|d��dddgf��|�|d��dgf��dS)Nz/path;attr1=value1;attr2=value2r-zattr1=value1zattr2=value2z/path;rz;attr1=value1;attr2=value2)r?r@�
_splitattrrB)rQrJs  rZ�test_splitattrzUtility_Tests.test_splitattr�s����L�+�	������#D�E�E�!�N�N�#C�D�	F�	F�	F������8�,�,�w���o�>�>�>������#?�@�@��~�~�>�?�	A�	A�	A������7�+�+�g�r�]�;�;�;�;�;rc�^�tjj}|�|d��d��|�|d��d��|�|d��d��|�|d��d��|�|d	��d
��dS)Nr�)r-�barzfoo=)r-rz=bar)rr��foobar)r�Nzfoo=bar=baz)r-zbar=baz)r?r@�_splitvaluerB)rQrRs  rZ�test_splitvaluezUtility_Tests.test_splitvalue�s����\�-�
������I�.�.��?�?�?������F�+�+�[�9�9�9������F�+�+�[�9�9�9������H�-�-�/?�@�@�@������M�2�2�4F�G�G�G�G�Grc���tj�d��}|�|d��|�t
tjjd��dS)Nzhttp://www.python.orguhttp://www.python.org/mediæval)r?r@�	_to_bytesrBr=�UnicodeErrorr�s  rZ�
test_to_byteszUtility_Tests.test_to_bytes�sb����'�'�(?�@�@������!8�9�9�9����,���(>�?�	A�	A�	A�	A�	Arc�z�dD]7}tj�|��}|�|d���8dS)N)z<URL:scheme://host/path>z<scheme://host/path>zURL:scheme://host/path�scheme://host/pathr�)r?r@rGrB)rQ�wrapped_urlrRs   rZ�test_unwrapzUtility_Tests.test_unwrap�sM��L�	8�	8�K��,�%�%�k�2�2�C����S�"6�7�7�7�7�	8�	8rN)rrr�__doc__rur}r�r�r�r�r�r�r�r�r�r�r�rrZrprp3s�������G�G�U�U�U�4�4�4�:J�J�J�9�9�9�$	7�	7�	7�H�H�H�
B�
B�
B�
D�
D�
D�<�<�<�H�H�H�A�A�A�8�8�8�8�8rrpc�V�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)�DeprecationTestc�&�|�t��5}tjj}|�|tjj��ddd��n#1swxYwY|�dt|j	����dS)NzQuoter will be removed)
�assertWarns�DeprecationWarningr?r@r7r�r8r:�str�warning)rQ�cm�	old_classs   rZ�test_Quoter_deprecationz'DeprecationTest.test_Quoter_deprecation�s���
�
�
�0�
1�
1�	;�R���+�I��M�M�)�V�\�%9�:�:�:�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;����	;�	;�	;�	;�	
�
�
�.��B�J���@�@�@�@�@s�7A�A"�%A"c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rMrBr�r��rQr�s  rZ�test_splittype_deprecationz*DeprecationTest.test_splittype_deprecation����
�
�
�0�
1�
1�	'�R��L�"�"�2�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�����R�Z���?�	@�	@�	@�	@�	@�� A�A�Ac��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rKrBr�r�r�s  rZ�test_splithost_deprecationz*DeprecationTest.test_splithost_deprecation�r�r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rNrBr�r�r�s  rZ�test_splituser_deprecationz*DeprecationTest.test_splituser_deprecation�r�r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rSrBr�r�r�s  rZ�test_splitpasswd_deprecationz,DeprecationTest.test_splitpasswd_deprecation�s���
�
�
�0�
1�
1�	)�R��L�$�$�R�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�����R�Z���?�	@�	@�	@�	@�	@r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rLrBr�r�r�s  rZ�test_splitport_deprecationz*DeprecationTest.test_splitport_deprecation�r�r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rPrBr�r�r�s  rZ�test_splitnport_deprecationz+DeprecationTest.test_splitnport_deprecation����
�
�
�0�
1�
1�	(�R��L�#�#�B�'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�����R�Z���?�	@�	@�	@�	@�	@r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rQrBr�r�r�s  rZ�test_splitquery_deprecationz+DeprecationTest.test_splitquery_deprecation�r�r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rHrBr�r�r�s  rZ�test_splittag_deprecationz)DeprecationTest.test_splittag_deprecations���
�
�
�0�
1�
1�	&�R��L�!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�����R�Z���?�	@�	@�	@�	@�	@r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() instead)r�r�r?r@rJrBr�r�r�s  rZ�test_splitattr_deprecationz*DeprecationTest.test_splitattr_deprecationr�r�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)NrzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() instead)r�r�r?r@rRrBr�r�r�s  rZ�test_splitvalue_deprecationz+DeprecationTest.test_splitvalue_deprecations���
�
�
�0�
1�
1�	(�R��L�#�#�B�'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�����R�Z���@�	A�	A�	A�	A�	Ar�c��|�t��5}tj�d��ddd��n#1swxYwY|�t
|j��d��dS)Nrz/urllib.parse.to_bytes() is deprecated as of 3.8)r�r�r?r@rIrBr�r�r�s  rZ�test_to_bytes_deprecationz)DeprecationTest.test_to_bytes_deprecations���
�
�
�0�
1�
1�	&�R��L�!�!�"�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�����R�Z���J�	L�	L�	L�	L�	Lr�N)rrrr�r�r�r�r�r�r�r�r�r�r�r�r�rrZr�r��s�������A�A�A�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�A�A�A�L�L�L�L�Lrr��__main__)rkrc�unittest�urllib.parser?rr#r(r.rgrp�TestCaser<rpr�r�mainr�rrZ�<module>r�s9��
�
�
�
�������������%��#��#����
)���H�)��"�I�)�
�2�J�)�	�8�*��	)�

�I�;��)�	�9�+��
)�
�I�;��)�
�|�n��)�����)���Z�(�)�)��>�"�#�)��j�\��)��\�<�0�1�)���Z�(�)�)�	�"�I�)� 
�2�J�!)�"�B�K�#)�$
�J�<��%)�&�[�M��')�(
�K�=��))�*�[�M��+)�,��� �-)�.�.�!�"�/)�0�,��-�.�1)�2�$�%�&�3)�4
�|�n��5)�6�n�n�5�6�7)�8�,��-�.�9)�:�k�]��;)�<�'�(�)�=)�>
�}�o��?)�@�*�+�,�A)�D�'�(�)�E)�F�)�*�+�G)�H�%�&�'�I)�J�6�7�8�K)�L�2�3�4�M)�N�&�'�(�O)�P�$�%�&�Q)��\*���H�*��"�I�*�
�2�J�*�	�2��t�*��	*�

�B���;��*�	�3���+��
*�
�C�"��;��*�
�s�U�G�n��*�������*��s�e�3�%�(�(�)�*��3��	�"�#�*��c�C�5�\��*��5�'���0�0�1�*���s�C�j�!�"�*�	�"�I�*� 
�2�J�!*�"�B�K�#*�$
�C�#��<��%*�&�S�4�&�M��'*�(
�D�3�%�=��)*�*�T�C�5�M��+*�,��v�h�� �-*�.�&�4�&�!�"�/*�0���t�f�-�-�.�1*�2�D�8�*�%�&�3*�4
�t�d�V�n��5*�6�V�H�V�H�5�5�6�7*�8�$��t��%�&�9*�:�d�S�E�]��;*�<�S�;�-�(�)�=*�>
�u�t�f�o��?*�@�d�\�?�+�,�A*�B��0�1�2�3�C*�F�X��x�(�)�G*�H�x�&��*�+�I*�J��H�:�&�'�K*�L�K�+��7�8�M*�N��k�]�3�4�O*�P�G�g�Y�'�(�Q*�R�'�G�9�%�&�S*��XI7�I7�I7�I7�I7�x�(�I7�I7�I7�V&U8�U8�U8�U8�U8�H�%�U8�U8�U8�pRL�RL�RL�RL�RL�h�'�RL�RL�RL�j�z����H�M�O�O�O�O�O��r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists