File: //lib/python3/dist-packages/twisted/python/test/__pycache__/test_url.cpython-310.pyc
o
�b q � @ sX d Z ddlmZ ddlmZ dZdZg d�Zdd � ZG d
d� de�Z G dd
� d
e�Z
dS )z"
Tests for L{twisted.python.url}.
� )�SynchronousTestCase� ��URL�*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 )zg/�http://a/b/c/g/)z/g�
http://a/g)z//gzhttp://g)z?yzhttp://a/b/c/d;p?y)zg?yzhttp://a/b/c/g?y)z#szhttp://a/b/c/d;p?q#s)zg#szhttp://a/b/c/g#s)zg?y#szhttp://a/b/c/g?y#s)z;xzhttp://a/b/c/;x)zg;xzhttp://a/b/c/g;x)zg;x?y#szhttp://a/b/c/g;x?y#s)� 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 )zg.zhttp://a/b/c/g.)z.gzhttp://a/b/c/.g)zg..zhttp://a/b/c/g..)z..gzhttp://a/b/c/..g)z./../gr )z./g/.r
)zg/./hzhttp://a/b/c/g/h)zg/../hzhttp://a/b/c/h)z g;x=1/./yzhttp://a/b/c/g;x=1/y)z
g;x=1/../yzhttp://a/b/c/y)zg?y/./xzhttp://a/b/c/g?y/./x)zg?y/../xzhttp://a/b/c/g?y/../x)zg#s/./xzhttp://a/b/c/g#s/./x)zg#s/../xzhttp://a/b/c/g#s/../xc C s d� dd� | D ��S )Nr c s s � | ] }d t |� V qdS )z%%%02XN)�ord)�.0�c� r �>/usr/lib/python3/dist-packages/twisted/python/test/test_url.py� <genexpr>G s � z<lambda>.<locals>.<genexpr>)�join)�sr r r �<lambda>G s r c @ sr e Zd ZdZdd� Zd\dd�Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zd7d8� Zd9d:� Zd;d<� Z d=d>� Z!d?d@� Z"dAdB� Z#dCdD� Z$dEdF� Z%dGdH� Z&dIdJ� Z'dKdL� Z(dMdN� Z)dOdP� Z*dQdR� Z+dSdT� Z,dUdV� Z-dWdX� Z.dYdZ� Z/d[S )]�TestURLz
Tests for L{URL}.
c C s� | � t|jt�p|jdu t|�� | � t|jt�p|jdu t|�� |jD ]}| �|tt|�� q%|jD ]\}}| �|tt|�� | � |du pKt|t�t|�� q4| �|j tt|�� dS )zl
The given L{URL}'s components should be L{unicode}.
@param u: The L{URL} to test.
N)
�
assertTrue�
isinstance�scheme�str�repr�host�path�assertIsInstance�query�fragment)�self�u�seg�k�vr r r �assertUnicodedO s ""
zTestURL.assertUnicodedr c C sL |j |j|j|j|j|j|jf} ||t|�t|�|||jf}
| �| |
� dS )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"