← Back
Editing: test_url.cpython-38.pyc
U W[�t � ( @ s� d Z ddlmZ ddlmZ ed�ZddlmZ dZ dZ d d ddd ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g(Zd1d2� ZG d3d4� d4e�Z G d5d6� d6e�Zd7S )8z" Tests for L{twisted.python.url}. � )�unicode_literals� ��URL� )�SynchronousTestCase�*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 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>O s z<lambda>.<locals>.<genexpr>)�join)�sr r r �<lambda>O � r c @ sz 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[d\� Z0d]S )_�TestURLz Tests for L{URL}. c C s� | � t|jt�p|jdkt|�� | � t|jt�p:|jdkt|�� |jD ]}| �|tt|�� qJ|jD ]8\}}| �|tt|�� | � |dkp�t|t�t|�� qh| �|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�unicode�repr�host�pathZassertIsInstance�query�fragment)�self�uZseg�k�vr r r �assertUnicodedV 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$ r% r&