Your IP : 216.73.216.213


Current Path : /opt/alt/python38/lib64/python3.8/test/test_email/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/test/test_email/__pycache__/test__encoded_words.cpython-38.pyc

U

i�fN�@s�ddlZddlmZddlmZddlmZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de�Z
Gd
d�de�ZGdd�de�Ze
dkr�e��dS)�N)�_encoded_words)�errors)�
TestEmailBasec@s0eZdZgfdd�Zdd�Zdd�Zdd�Zd	S)
�TestDecodeQcCs*t�|�\}}|�||�|�||�dS�N)�_ewZdecode_q�assertEqual�assertDefectsEqual��self�sourceZ	ex_resultZ
ex_defects�result�defects�r�H/opt/alt/python38/lib64/python3.8/test/test_email/test__encoded_words.py�_test	szTestDecodeQ._testcCs|�dd�dS)N�foobar�r�rrrr�test_no_encodedszTestDecodeQ.test_no_encodedcCs|�dd�|�dd�dS)Nsfoo=20bar=20�foo bar sfoo_bar_rrrrr�test_spacesszTestDecodeQ.test_spacescCs|�dd�dS)Nsfoo=20=20=21=2Cbars
foo  !,barrrrrr�test_run_of_encodedszTestDecodeQ.test_run_of_encodedN)�__name__�
__module__�__qualname__rrrrrrrrrsrc@s@eZdZgfdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestDecodeBcCs*t�|�\}}|�||�|�||�dSr)rZdecode_brr	r
rrrrszTestDecodeB._testcCs|�dd�dS)NsZm9v�foorrrrr�test_simple szTestDecodeB.test_simplecCs(|�ddtjg�|�ddtjg�dS)Nsdmk�visdg�v�rr�InvalidBase64PaddingDefectrrrr�test_missing_padding#sz TestDecodeB.test_missing_paddingcCs|�ddtjg�dS)Nsdmk===r�rr�InvalidBase64CharactersDefectrrrr�test_invalid_character)sz"TestDecodeB.test_invalid_charactercCs|�ddtjtjg�dS)Nsdmkr�rrr%r"rrrr�&test_invalid_character_and_bad_padding,s�z2TestDecodeB.test_invalid_character_and_bad_paddingcCs|�ddtjg�dS)Nsabcde)rrZInvalidBase64LengthDefectrrrr�test_invalid_length0szTestDecodeB.test_invalid_lengthN)	rrrrrr#r&r(r)rrrrrsrc@s�eZdZdd�Zddgfdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�
TestDecodec	Cs�|�t��t�d�W5QRX|�t��t�d�W5QRX|�t��t�d�W5QRX|�t��t�d�W5QRXdS)Nz
=?badone?=z=?�z=?utf-8?X?somevalue?=)ZassertRaises�
ValueErrorr�decode�KeyErrorrrrr�test_wrong_format_input_raises6sz)TestDecode.test_wrong_format_input_raises�us-asciir+c
CsFt�|�\}}}}	|�||�|�||�|�||�|�|	|�dSr)rr-rr	)
rrr
�charset�langr�res�char�l�drrrr@s
zTestDecode._testcCs|�dd�dS)Nz=?us-ascii?q?foo?=�foorrrrr�
test_simple_qGszTestDecode.test_simple_qcCs|�dd�dS)Nz=?us-ascii?b?dmk=?=�virrrrr�
test_simple_bJszTestDecode.test_simple_bcCs|�dd�dS)Nz=?us-ascii?Q?foo?=r7rrrrr�test_q_case_ignoredMszTestDecode.test_q_case_ignoredcCs|�dd�dS)Nz=?us-ascii?B?dmk=?=r9rrrrr�test_b_case_ignoredPszTestDecode.test_b_case_ignoredcCs|�ddd�dS)Nz!=?latin-1?q?=20F=fcr=20Elise=20?=u Für Elise zlatin-1rrrrr�test_non_trivial_qSszTestDecode.test_non_trivial_qcCs |jd�dd�dtjgd�dS)Ns=?us-ascii?q?=20�foo?=r0�surrogateescapeu �foo�r)rr-rZUndecodableBytesDefectrrrr�test_q_escaped_bytes_preservedVs
��z)TestDecode.test_q_escaped_bytes_preservedcCs$|jd�dd�dtjtjgd�dS)Ns=?us-ascii?b?dm�k?=r0r>r9r?)rr-rr%r"rrrr�,test_b_undecodable_bytes_ignored_with_defect\s
���z7TestDecode.test_b_undecodable_bytes_ignored_with_defectcCs|jddtjgd�dS)Nz=?us-ascii?b?dmk===?=r9r?r$rrrr�(test_b_invalid_bytes_ignored_with_defectds�z3TestDecode.test_b_invalid_bytes_ignored_with_defectcCs|jddtjtjgd�dS)Nz=?us-ascii?b?dmk?=r9r?r'rrrr�&test_b_invalid_bytes_incorrect_paddingis��z1TestDecode.test_b_invalid_bytes_incorrect_paddingcCs|jddtjgd�dS)Nz=?us-ascii?b?dmk?=r9r?r!rrrr�test_b_padding_defectps�z TestDecode.test_b_padding_defectcCs|jdddd�dS)Nz=?us-ascii*jive?q?test?=Ztest�jive�r2rrrrr�test_nonnull_languszTestDecode.test_nonnull_langcCs|jdd�dd�dgd�dS)N�=?unknown-8bit?q?foo=ACbar?=�foo�bar�asciir>�unknown-8bit�r1r)rr-rrrr�test_unknown_8bit_charsetxs

�z$TestDecode.test_unknown_8bit_charsetcCs"|jdd�dd�dtjgd�dS)Nz=?foobar?q?foo=ACbar?=rIrJr>�foobarrL)rr-rZCharsetErrorrrrr�test_unknown_charset~s

�zTestDecode.test_unknown_charsetcCs|jdddd�dS)Nz=?utf-8?q?=C3=89ric?=uÉric�utf-8�r1rrrrr�test_q_nonascii�s�zTestDecode.test_q_nonasciiN)rrrr/rr8r:r;r<r=r@rArBrCrDrGrMrOrRrrrrr*4s 
r*c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestEncodeQcCs|�t�|�|�dSr)rrZencode_q)r�srcZexpectedrrrr�szTestEncodeQ._testcCs|�dd�dS)NrrNrrrrr�
test_all_safe�szTestEncodeQ.test_all_safecCs|�dd�dS)NrZfoo_bar_rrrrrr�szTestEncodeQ.test_spacescCs|�dd�dS)Ns
foo  ,,barzfoo__=2C=2Cbarrrrrr�test_run_of_encodables�sz"TestEncodeQ.test_run_of_encodablesN)rrrrrUrrVrrrrrS�srSc@seZdZdd�Zdd�ZdS)�TestEncodeBcCs|�t�d�d�dS)NrZZm9v�rrZencode_brrrrr�szTestEncodeB.test_simplecCs|�t�d�d�dS)Nrzdmk=rXrrrr�test_padding�szTestEncodeB.test_paddingN)rrrrrYrrrrrW�srWc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
TestEncodecCs|�t�ddd�d�dS)Nr7rP�q�=?utf-8?q?foo?=�rr�encoderrrr�test_q�szTestEncode.test_qcCs|�t�ddd�d�dS)Nr7rP�bz=?utf-8?b?Zm9v?=r]rrrr�test_b�szTestEncode.test_bcCs|�t�dd�d�dS)Nr7rPr\r]rrrr�test_auto_q�szTestEncode.test_auto_qcCs|�t�dd�d�dS)Nzvi.rPz=?utf-8?q?vi=2E?=r]rrrr� test_auto_q_if_short_mostly_safe�sz+TestEncode.test_auto_q_if_short_mostly_safecCs|�t�dd�d�dS)Nz.....rPz=?utf-8?b?Li4uLi4=?=r]rrrr�test_auto_b_if_enough_unsafe�sz'TestEncode.test_auto_b_if_enough_unsafecCs|�t�dd�d�dS)Nzvi.vi.vi.vi.vi.rPz =?utf-8?b?dmkudmkudmkudmkudmku?=r]rrrr�test_auto_b_if_long_unsafe�s�z%TestEncode.test_auto_b_if_long_unsafecCs|�t�dd�d�dS)Nzvi vi vi.vi rPz=?utf-8?q?vi_vi_vi=2Evi_?=r]rrrr�test_auto_q_if_long_mostly_safe�s�z*TestEncode.test_auto_q_if_long_mostly_safecCs|�t�d�d�dS)Nr7r\r]rrrr�test_utf8_default�szTestEncode.test_utf8_defaultcCs|�tjddd�d�dS)Nr7rErFz=?utf-8*jive?q?foo?=r]rrrr�	test_lang�szTestEncode.test_langcCs|�tjddd�d�dS)Nu	foo�barrKrQrHr]rrrr�test_unknown_8bit�s�zTestEncode.test_unknown_8bitN)
rrrr_rarbrcrdrerfrgrhrirrrrrZ�srZ�__main__)ZunittestZemailrrrZtest.test_emailrrrr*rSrWrZr�mainrrrr�<module>sW	$