HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/test_email/__pycache__/test_parser.cpython-312.opt-2.pyc
�

}h�e�����ddlZddlZddlZddlmZmZddlmZddlm	Z	Gd�de	�Z
Gd�d�Zd	�ZGd
�dee	�Z
d�Zd
�ZGd�dee	�Zedk(rej$�yy)�N)�Message�EmailMessage)�default)�
TestEmailBasec�f�eZdZGd�de�Zejjd��Zd�Z	d�Z
y)�TestCustomMessagec���eZdZ�fd�Z�xZS)�TestCustomMessage.MyMessagec�0��||_t�|�	�y�N)�check_policy�super�__init__)�self�policy�	__class__s  ��B/opt/alt/python312/lib64/python3.12/test/test_email/test_parser.pyrz$TestCustomMessage.MyMessage.__init__s��� &�D���G���)�__name__�
__module__�__qualname__r�
__classcell__)rs@r�	MyMessager
s
���	�	rr�boo)�linesepc���tjd|j|j��}|j	||j�|j|j|j�y�NzSubject: bogus

msg
�r)�email�message_from_stringr�MyPolicy�assertIsInstance�assertIsr
)r�msgs  r�7test_custom_message_gets_policy_if_possible_from_stringzITestCustomMessage.test_custom_message_gets_policy_if_possible_from_stringsQ���'�'�(A�(,���/3�}�}�>��	
���c�4�>�>�2��
�
�c�&�&��
�
�6rc�
�tjd�}tj||j|j
��}|j
||j�|j|j|j
�yr)	�io�StringIOr�message_from_filerr!r"r#r
)r�source_filer$s   r�5test_custom_message_gets_policy_if_possible_from_filezGTestCustomMessage.test_custom_message_gets_policy_if_possible_from_files_���k�k�";�<���%�%�k�&*�n�n�-1�]�]�<��	
���c�4�>�>�2��
�
�c�&�&��
�
�6rN)rrrrrrr�cloner!r%r+�rrrr	s3���G��
�#�#�)�)�%�)�8�H�7�7rrc�4�eZdZd�ZGd�de�Zd�Zd�Zy)�TestParserBasec�(�|jD]w}|j|j��5|dt��}|j	|j�gd��|j	|j
�d�ddd��yy#1swY��xYw)N��parseru�Next-Line: not…broken
Null: notbroken
Vertical-Tab: notbroken
Form-Feed: notbroken
File-Separator: notbroken
Group-Separator: notbroken
Record-Separator: notbroken
Line-Separator: not
broken
Paragraph-Separator: not
broken

r)	)z	Next-Lineunot…broken)�Nullz
notbroken)zVertical-Tabz
notbroken)z	Form-Feedz
notbroken)zFile-Separatorz
notbroken)zGroup-Separatorz
notbroken)zRecord-Separatorz
notbroken)zLine-Separatorunot
broken)zParagraph-Separatorunot
broken�)�parsers�subTestrr�assertEqual�items�get_payload)rr2r$s   r�test_only_split_on_cr_lfz'TestParserBase.test_only_split_on_cr_lf&s����l�l�	8�F����V�_�_��5�
8��	�#���� � �����
/�
�� � ����!2�B�7�3
8�
8�	8�
8�
8�s�AB�B	c��eZdZy)�TestParserBase.MyMessageN)rrrr-rrrr<Fs��rrc��|jD]m}|j|j��5tj|j
��}|d|��}|j
||j
�ddd��oy#1swY�zxYw�Nr1)�message_factoryz
To: foo

testr)r5r6rrr,rr"�rr2r!r$s    r�%test_custom_message_factory_on_policyz4TestParserBase.test_custom_message_factory_on_policyIst���l�l�	;�F����V�_�_��5�
;�"�=�=����H���.�x�@���%�%�c�4�>�>�:�
;�
;�	;�
;�
;�s�AA>�>B	c�J�|jD]�}|j|j��5tj|j
��}|dt|��}|j||j
�|j|t�ddd���y#1swY��xYwr>)	r5r6rrr,rr�assertNotIsInstancer"r@s    r�!test_factory_arg_overrides_policyz0TestParserBase.test_factory_arg_overrides_policyPs����l�l�	4�F����V�_�_��5�
4�"�=�=����H���.���I���(�(��d�n�n�=��%�%�c�7�3�	
4�
4�	4�
4�
4�s�A"B�B"	N)rrrr:rrrArDr-rrr/r/$s��8�@
�L�
�;�4rr/c�^�tj|�}tj|g|��i|��Sr)r'r(rr)��s�args�kw�fs    rr)r)[s*��
���A��A��"�"�1�2�t�2�r�2�2rc�(�eZdZejefZy)�
TestParserN)rrrrr r)r5r-rrrLrL_s���(�(�*;�<�GrrLc�P�tj|j�g|��i|��Sr)r�message_from_bytes�encode)rGrHrIs   rrNrNbs#���#�#�A�H�H�J�<��<��<�<rc�z�tj|j��}tj|g|��i|��Sr)r'�BytesIOrOr�message_from_binary_filerFs    rrRrRes1��
�
�
�1�8�8�:��A��)�)�!�9�d�9�b�9�9rc��eZdZeefZy)�TestBytesParserN)rrrrNrRr5r-rrrTrTis
��!�#;�<�GrrT�__main__)r'r�unittest�
email.messagerr�email.policyr�test.test_emailrrr/r)rLrNrRrTr�mainr-rr�<module>r[ss��	���/� �)�7�
�7�624�24�n3�=���=�=�:�=�n�m�=��z���H�M�M�O�r