%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/hyperlink/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/hyperlink/test/__pycache__/test_decoded_url.cpython-312.pyc

�

G�_���f�ddlmZddlmZmZddlmZmZddlm	Z	ddl
mZdZd	Z
Gd
�de�Zy)
�)�unicode_literals)�Dict�Union�)�
DecodedURL�URL)�_percent_decode�)�HyperlinkTestCasezhttp://example.com/#uahttps://%75%73%65%72:%00%00%00%00@xn--bcher-kva.ch:8080/a/nice%20nice/./path/?zot=23%25&zut#frégc�T�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�TestURLc�.�tjt�}|jdk(sJ�|jdk(sJ�|j
dk(sJ�|jdk(sJ�|jdk(sJ�tjt�}|jdk(sJ�|jdk(sJ�|j
dk(sJ�|jd	k(sJ�|jd
k(sJ�|jd�dgk(sJ�|jd
k(sJ�|jdk(sJ�y)N�httpzexample.com�P)�r�httpsu
bücher.chi�)�az	nice nice�.�pathrufrég�zot�23%�user)rz)r�	from_text�	BASIC_URL�scheme�host�portr�fragment�	TOTAL_URL�getr�userinfo)�self�bdurl�durls   �A/usr/lib/python3/dist-packages/hyperlink/test/test_decoded_url.py�test_durl_basiczTestURL.test_durl_basics���$�$�Y�/���|�|�v�%�%�%��z�z�]�*�*�*��z�z�R�����z�z�U�"�"�"��~�~��#�#�#��#�#�I�.���{�{�g�%�%�%��y�y�L�(�(�(��y�y�D� � � ��y�y�?�?�?�?��}�}��'�'�'��x�x���5�'�)�)�)��y�y�F�"�"�"��}�}� 4�4�4�4�c��tjt�}|jd�jddk(sJ�|jd�jddk(sJ�|j�|k(sJ�|j�|usJ�|j
d�jddk(sJ�|jdk(sJ�d|jvsJ�d|j�jvsJ�|j�jdk(sJ�d	|j�jd
vsJ�|jd��tk(sJ�|jsJ�|jsJ�||jj!�k(sJ�tjtd�
�}||jj!d�
�k(sJ�t#tjt$�jd	��dk(sJ�|d
k(rJ�|d
k7sJ�y)Nzte%t���z	../test2%�/rrrz	fr%C3%A9g� r
T)�
with_password)�lazyzhttp://example.com/%20)rrr�siblingr�child�clickr�	normalize�to_urir�to_iri�to_text�absolute�rooted�encoded_url�get_decoded_url�strr�r"r$�durl2s   r%�test_passthroughszTestURL.test_passthroughs's����#�#�I�.���|�|�F�#�(�(��,��6�6�6��z�z�+�&�+�+�B�/�;�>�>�>��z�z�|�t�#�#�#��z�z�|�t�#�#�#��z�z�#��#�#�B�'�2�-�-�-��y�y�F�"�"�"��d�i�i�����$�.�.�*�/�/�/�/�/��{�{�}�%�%��4�4�4��d�k�k�m�(�(��+�+�+�+��|�|�$�|�/�9�<�<�<��}�}��}��{�{��{��t�'�'�7�7�9�9�9�9��$�$�Y�T�:����)�)�9�9�t�9�D�D�D�D�
�
�$�$�Y�/�5�5�c�:�;�'�
(�	
�
(��A�I����q�y��yr'c��tjt�}t|�dt|j�zdzk(sJ�y)NzDecodedURL(url=�))rrr�repr�_url�r"r$s  r%�	test_reprzTestURL.test_reprMs7���#�#�I�.���D�z�.��d�i�i��@�3�F�F�F�Fr'c���tjt�}|jd�dgk(sJ�|j	dd�}|jd�dgk(sJ�|jdd�}|jd�dgk(sJ�t|j
���}|jd�dgk(sJ�|jd�}|jd�gk(sJ�tjd�}|jd�d	d
gk(sJ�|jdd�jd�dgk(sJ�tjd�}|jd
�tjd�k(sJ�|jd
d��tjd�k(sJ�|jd
d��tjd�k(sJ�|jd
dd��tjd�k(sJ�y)Nrrr+�spacezspa%ed)�urlz/?%61rg=b&arg=c�arg�b�c�du.https://example.com/a/b/?fóó=1&bar=2&fóó=3ufóózhttps://example.com/a/b/?bar=2�1)�valueu&https://example.com/a/b/?bar=2&fóó=3r
)�limitr)rKrL)rrrr �add�setr2�removerAs  r%�test_query_manipulationzTestURL.test_query_manipulationRs����#�#�I�.���x�x���5�'�)�)�)��x�x��W�%���x�x��}��	�)�)�)��x�x��X�&���x�x��}��
�*�*�*��d�k�k�m�,���x�x��}��
�*�*�*��{�{�3����x�x��}��"�"�"��#�#�$5�6���x�x���3��*�,�,�,��x�x��s�#�'�'��.�3�%�7�7�7��#�#�<�
���{�{�7�#�z�';�';�,�(
�
�	
�
��{�{�7�#�{�.�*�2F�2F�4�3
�
�	
�
��{�{�7�!�{�,�
�0D�0D�4�1
�
�	
�
��{�{�7�#�Q�{�7�:�;O�;O�<�<
�
�	
�
r'c��tjt�}tjt�}tjt�}|j	�}||k(sJ�||k(sJ�||k7sJ�|�J�||j
k7sJ�tttf}i}|||<|||<t|�dk(sJ�|||<t|�dk(sJ�|||<t|�dk(sJ�y)Nr
r�)	rrrrr2r@rr�len)r"r$r;�burl�durl_uri�AnyURL�durl_maps       r%�test_equality_and_hashabilityz%TestURL.test_equality_and_hashabilityvs����#�#�I�.���$�$�Y�/���#�#�I�.���;�;�=���t�|��|��u�}��}��t�|��|������t�y�y� � � ��s�J��'�������������8�}��!�!�!������8�}��!�!�!�%�����8�}��!�!�!r'c�,�tjt�}|j|j|j
|j|j|j|j|j|j|j��	}||k(sJ�y)N)	rrr�queryrrr6r!�uses_netloc)
rrr�replacerrrrZrrr6r!r[r:s   r%�test_replace_roundtripzTestURL.test_replace_roundtrip�st���#�#�I�.������;�;��������*�*��]�]�����;�;��]�]��(�(��

���u�}��}r'c��tjt�}|jt�5|jd��ddd�y#1swYyxYw)N)r�pw�thiswillcauseafailure)r!)rrr�assertRaises�
ValueErrorr\rAs  r%�test_replace_userinfozTestURL.test_replace_userinfo�sP���#�#�I�.��
�
�
�z�
*�	��L�L��
�
�	�	�	�	�s�A�Ac���tjt�}|tjt�k(sJ�dt	|�vsJ�dt	|�vsJ�|j�|j
�k(sJ�y)Nr4�asText)rrr�fromText�dirr4rerAs  r%�test_twisted_compatzTestURL.test_twisted_compat�si���#�#�I�.���z�*�*�9�5�5�5�5��C��I�%�%�%��s�4�y�(�(�(��|�|�~�����.�.�.r'c���td�dk(sJ�td�dk(sJ�|jt�5tdd��ddd�tdd��dk(sJ�y#1swY�xYw)	Nuabcdé%C3%A9éfguabcdéééfgu
abcdé%C3éfgT)�raise_subencoding_excué%25é�ascii)�subencoding)r	ra�UnicodeDecodeError)r"s r%�test_percent_decode_mixedz!TestURL.test_percent_decode_mixed�sx��
�1�2�n�D�D�D���/�?�B�B�B��
�
�1�
2�	I��O�4�H�	I��y�g�>�)�K�K�K�		I�	I�s�A�A(c��tjt�}tjd�}|j|�}|j|jk(sJ�|j
|j
k(sJ�|j
dk(sJ�y)Nu/tëst)utëst)rrrr0rr)r"r$�	durl_dest�clickeds    r%�test_click_decoded_urlzTestURL.test_click_decoded_url�sn���#�#�I�.���(�(��2�	��*�*�Y�'���|�|�t�y�y�(�(�(��|�|�y�~�~�-�-�-��|�|�z�)�)�)r'c��tjd�}|jdk(sJ�|jd�dgk(sJ�|jdk(sJ�y)N�/x+y%2B?a=b+c%2B�zx+y+r�b c+))rrv�rrrr rZrAs  r%�test_decode_pluszTestURL.test_decode_plus�sP���#�#�$6�7���y�y�I�%�%�%��x�x��}���(�(�(��z�z�-�-�-�-r'c��tjdd��}|jdk(sJ�|jd�dgk(sJ�|jdk(sJ�y)NrtF)�query_plus_is_spacerur�b+c+))rr{rwrAs  r%�test_decode_nonplussedzTestURL.test_decode_nonplussed�sV���#�#��E�
���y�y�I�%�%�%��x�x��}���(�(�(��z�z�-�-�-�-r'N)�__name__�
__module__�__qualname__r&r<rBrPrXr]rcrhrnrrrxr|�r'r%r
r
sB��5�*$�LG�
"
�H"�:�$�/�L�"*�.�.r'r
N)�
__future__r�typingrrrrrr@r	�commonrrrr
r�r'r%�<module>r�s4��(���"�%�"�	�0�
�S.��S.r'

Zerion Mini Shell 1.0