File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_charmapcodec.cpython-37.pyc
B
��g� � @ sP d Z ddlZddlZdd� Ze�e� dZG dd� dej�ZedkrLe� � dS ) z� Python character mapping codec test
This uses the test codec in testcodec.py and thus also tests the
encodings package lookup scheme.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
� Nc C s$ | dkr ddl m} t|�� �S d S )N� testcodecr )r )Ztestr �tuple�getregentry)�encodingr � r �2/usr/local/lib/python3.7/test/test_charmapcodec.py�codec_search_function s r r c @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S )
�CharmapCodecTestc C s^ | � tdt�d� | � tdt�d� | � tdt�d� | � tdt�d� | � td t�d
� d S )Ns abc�abcs xdefZabcdefs defxZdefabcs dxfZdabcfs dxfxZdabcfabc)�assertEqual�str� codecname)�selfr r r �test_constructorx s
z"CharmapCodecTest.test_constructorxc C s^ | � d�t�d� | � d�t�d� | � d�t�d� | � d�t�d� | � d �t�d
� d S )Nr
s abcZxdefs abcdefZdefxs defabcZdxfs dabcfZdxfxs dabcfabc)r �encoder
)r r r r �test_encodex$ s
zCharmapCodecTest.test_encodexc C sL | � tdt�d� | � tdt�d� | � tdt�d� | � tdt�d� d S )Ns ydef�defs defys dyfZdfs dyfy)r r r
)r r r r �test_constructory+ s z"CharmapCodecTest.test_constructoryc C s | � ttdt� d S )Ns abc)ZassertRaises�UnicodeErrorr r
)r r r r �test_maptoundefined1 s z$CharmapCodecTest.test_maptoundefinedN)�__name__�
__module__�__qualname__r r r r r r r r r s r �__main__)
�__doc__Zunittest�codecsr �registerr
ZTestCaser r �mainr r r r �<module>
s