관리-도구
편집 파일: tests.cpython-38.pyc
U ��.e� � @ s� d Z ddlmZ ddlmZmZmZmZmZm Z m Z mZmZ dd� Z dd� Zd d � Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� ZdS )z� webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. � )�unicode_literals� ) �lookup�LABELS�decode�encode�iter_decode�iter_encode�IncrementalDecoder�IncrementalEncoder�UTF8c O s6 z|||� W n | k r$ Y d S X t d| ��d S )NzDid not raise %s.��AssertionError)Z exceptionZfunction�args�kwargs� r �B/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/tests.py� assert_raises s r c C s t d�jdkst�t d�jdks$t�t d�jdks6t�t d�jdksHt�t d�jdksZt�t d�jdkslt�t d�jdks~t�t d�d ks�t�t d�d ks�t�t d �jd ks�t�t d�jd ks�t�t d�jd ks�t�t d �jd ks�t�t d�d ks�t�t d�d k�st�d S )Nzutf-8zUtf-8zUTF-8�utf8zutf8 z utf8 �u8u utf-8 zUS-ASCIIzwindows-1252z iso-8859-1�latin1ZLATIN1zlatin-1u LATİN1)r �namer r r r r �test_labels s r c C s t D ]�} td| �dt| �fks"t�td| �dks4t�dD ]D}tdg| | �\}}t|�g ks`t�ttdg| | ��g ks8t�q8t| �}|�d�dks�t�|jddd�dks�t�t | �}|�d�dks�t�|jddd�dkst�qt t �� �D ]}t|�j|ks�t�q�d S )N� � )r r � T)�final) r r r r r r �listr r r �set�valuesr )Zlabel�repeat�output�_�decoder�encoderr r r r �test_all_labels0 s r% c C sT t ttdd� t ttdd� t ttg d� t ttg d� t ttd� t ttd� d S )N� éZinvalid� é)r �LookupErrorr r r r r r r r r r �test_invalid_labelC s r) c C s� t dd�dtd�fkst�t dtd��dtd�fks8t�t dd�dtd�fksRt�t dt�dtd�fkslt�t dd�dtd�fks�t�t d d�dtd�fks�t�t d d�dtd�fks�t�t dd�dtd �fks�t�t dd�dtd�fks�t�t dd�dtd �fk�s t�t dd�dtd�fk�s&t�t dd�dtd �fk�sBt�t dd�dtd �fk�s^t�t dd�dtd�fk�szt�t dd�dtd �fk�s�t�t dd�dtd �fk�s�t�d S )N� �r u €� ér r'