HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/usr/lib/python3/dist-packages/lazr/uri/tests/__pycache__/test_uri.cpython-38.pyc
U

��O`�@sPdZeZdgZddlZddlmZmZmZm	Z	m
Z
Gdd�dej�Zdd�Z
dS)	zUnit tests.Z
test_suite�N)�InvalidURIError�URI�find_uris_in_text�merge�remove_dot_segmentsc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�URITestCasecCs||�ttd��d�|�ttd��d�|�ttd��d�|�ttd��d�|�ttd	��d�|�ttd
��d�dS)Nz"eXAMPLE://a/./b/../b/%63/%7bfoo%7dzexample://a/b/c/%7Bfoo%7Dzhttp://www.EXAMPLE.com/zhttp://www.example.com/zhttp://www.gnome.org/%7ejamesh/zhttp://www.gnome.org/~jamesh/zhttp://example.comzhttp://example.com/zhttp://example.com:/zhttp://example.com:80/)�assertEqual�strr��self�r�9/usr/lib/python3/dist-packages/lazr/uri/tests/test_uri.py�test_normalisation s$������zURITestCase.test_normalisationcCs|�ttd�dS)Nuhttp://€xample.com/)ZassertRaisesrrr
rrr
�test_invalid_uri3szURITestCase.test_invalid_uricCs\|�tdddd�d�|�tdddd�d�|�tdddd�d�|�td	ddd�d�dS)
N�ZfooT)Z
has_authorityz/fooFz/a/b/cz/a/b/fooz/a/b/)rrr
rrr
�
test_merge6s��zURITestCase.test_mergecCs$|�td�d�|�td�d�dS)Nz/a/b/c/./../../gz/a/gzmid/content=5/../6zmid/6)rrr
rrr
�test_remove_dot_segments@sz$URITestCase.test_remove_dot_segmentscs�td���fdd�}|�|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�|�|d�d�|�|d�d�|�|d�d �|�|d!�d �|�|d"�d#�|�|d$�d#�|�|d%�d&�|�|d'�d(�|�|d)�d(�|�|d*�d�dS)+N�http://a/b/c/d;p?qcst��|��S�N�r	�resolve��relative��baserr
rHsz3URITestCase.test_normal_resolution.<locals>.resolvezg:h�gzhttp://a/b/c/gz./gzg/�http://a/b/c/g/z/g�
http://a/gz//gz	http://g/z?yzhttp://a/b/c/d;p?yzg?yzhttp://a/b/c/g?yz#szhttp://a/b/c/d;p?q#szg#szhttp://a/b/c/g#szg?y#szhttp://a/b/c/g?y#sz;xzhttp://a/b/c/;xzg;xzhttp://a/b/c/g;xzg;x?y#szhttp://a/b/c/g;x?y#sr�.z
http://a/b/c/z./z..zhttp://a/b/z../z../g�http://a/b/gz../..z	http://a/z../../z../../g�rr�rrrrr
�test_normal_resolutionEs2z"URITestCase.test_normal_resolutioncs8td���fdd�}|�|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�|�|d�d�|�|d�d�|�|d�d �|�|d!�d"�|�|d#�d$�dS)%Nrcst��|��Srrrrrr
rfsz5URITestCase.test_abnormal_resolution.<locals>.resolvez
../../../grz
../../../../gz/./gz/../gzg.zhttp://a/b/c/g.z.gzhttp://a/b/c/.gzg..zhttp://a/b/c/g..z..gzhttp://a/b/c/..gz./../grz./g/.rzg/./hzhttp://a/b/c/g/hzg/../hzhttp://a/b/c/hz	g;x=1/./yzhttp://a/b/c/g;x=1/yz
g;x=1/../yzhttp://a/b/c/yzg?y/./xzhttp://a/b/c/g?y/./xzg?y/../xzhttp://a/b/c/g?y/../xzg#s/./xzhttp://a/b/c/g#s/./xzg#s/../xzhttp://a/b/c/g#s/../xr r!rrr
�test_abnormal_resolutioncs(z$URITestCase.test_abnormal_resolutioncCs<td�}|�|�d��|�|�d��|�|�d��dS)N�http://code.launchpad.dev/foozcode.launchpad.devz
launchpad.devr)rZ
assertTrue�underDomain�rZurirrr
�"test_underDomain_matches_subdomainsz.URITestCase.test_underDomain_matches_subdomaincCs<td�}|�|�d��|�|�d��|�|�d��dS)Nr$zbeta.code.launchpad.devz
google.comzunchpad.dev)rZassertFalser%r&rrr
�+test_underDomain_doesnt_match_non_subdomain�sz7URITestCase.test_underDomain_doesnt_match_non_subdomainN)�__name__�
__module__�__qualname__rrrrr"r#r'r(rrrr
rs
rcCst���t�Sr)�unittestZ
TestLoaderZloadTestsFromNamer)rrrr
�additional_tests�sr-)�__doc__�typeZ
__metaclass__�__all__r,Zlazr.urirrrrrZTestCaserr-rrrr
�<module>s�r