관리-도구
편집 파일: tests.cpython-38.pyc
U ʗRe� � @ 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)� exception�function�args�kwargs� r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/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 )�label�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� é�invalid� é)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+ �ascii� ér) � �� �utf-16be� ��� �utf-16les ��� u s �� �� �zUTF-16BE� � zUTF-16LEzUTF-16)r r r r r r r r �test_decodeL s r8 c C sp t dd�dkst�t dd�dks$t�t dd�dks6t�t dd�dksHt�t dd�dksZt�t dd �d kslt�d S )Nr+ r � �r r/ �utf-16r7 r5 r3 r6 )r r r r r r �test_encodeb s r; c C s� dd� } | g d�dkst �| dgd�dks.t �| dgd�dksBt �| dgd�d ksVt �| d dgd�d kslt �| dd gd�d ks�t �| dgd�dks�t �| dgd�dks�t �| dddgd�dks�t �| dddgd�dks�t �| ddddddgd�dks�t �| dgd�dk�st �| dgd�dk�s$t �| dgd�dk�s:t �| dgd�dk�sPt �| ddddddgd�dk�spt �| dddgd �d!k�s�t �d S )"Nc S s t | |�\}}d�|�S )Nr )r �join)�input�fallback_encodingr$ � _encodingr r r �iter_decode_to_stringl s z/test_iter_decode.<locals>.iter_decode_to_stringr r r r9 r+ s helloZhellos hes llos hell� or/ r1 r) s � �� �� au a�� �s ���s �u ï»r2 r4 � �s ��� s h�x-user-definedu hllor )r@ r r r �test_iter_decodek s� ��� ��� ��� ��� ���rI c C s� d� tg d��dkst�d� tdgd��dks2t�d� tdgd��dksLt�d� tddddgd��dkslt�d� tddddgd��dks�t�d� tddddgd��dks�t�d� tddddgd ��d ks�t�d� tddddgd ��dks�t�d S )Nr r r r+ r9 r: r7 r5 r3 r6 u hZllorH s h�llo)r<