https://t.me/RX1948
Server : LiteSpeed
System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User : idnco5810 ( 1093)
PHP Version : 8.2.29
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/mail/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/mail/test/__pycache__/test_bounce.cpython-310.pyc
o

�b��@sNddlZddlZddlmZmZddlmZddlm	Z	Gdd�de	j
�ZdS)�N)�BytesIO�StringIO)�bounce)�unittestc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�BounceTestsz#
    Bounce message generation
    cCs�t�td�dd�\}}}|�|d�|�|d�tj��}|�t|�d���}|�|dd�|�|dd	�|�|d
d�dS)
zN
        L{twisted.mail.bounce.generateBounce} can accept L{unicode}.
        zRFrom: Moshe Zadka <moshez@example.com>
To: nonexistent@example.org
Subject: test

�moshez@example.com�nonexistent@example.org��moshez@example.com�utf-8�To�From�postmaster@example.org�subject�)Returned Mail: see transcript for detailsN)	r�generateBouncer�assertEqual�email�parser�Parser�parse�decode��self�fromAddress�to�s�emailParser�mess�r�?/usr/lib/python3/dist-packages/twisted/mail/test/test_bounce.py�test_bounceMessageUnicode��
�
z%BounceTests.test_bounceMessageUnicodecCs�t�td�dd�\}}}|�|d�|�|d�tj��}|�t|�	d���}|�|dd�|�|dd	�|�|d
d�dS)
zL
        L{twisted.mail.bounce.generateBounce} can accept L{bytes}.
        �RFrom: Moshe Zadka <moshez@example.com>
To: nonexistent@example.org
Subject: test

r
�nonexistent@example.orgr	rrrr
rrrN)
rrrrrrrrrrrrrr �test_bounceMessageBytes)r"z#BounceTests.test_bounceMessageBytescCs�t�td�ddd�\}}}|�|d�|�|d�tj��}|�t|�	d���}|�|dd�|�|d	d
�|�|dd�|�
|���|��}|�|d
��d�dS)z\
        Pass a custom transcript message to L{twisted.mail.bounce.generateBounce}.
        r#r
r$zCustom transcriptr	rrrr
rrrrzCustom transcript
N)
rrrrrrrrrr�
assertTrue�is_multipart�get_payload)rrrrrr�partsrrr �"test_bounceMessageCustomTranscriptAs$�
�

z.BounceTests.test_bounceMessageCustomTranscriptcCs�t�|||�dd�\}}}tj��}|�t|�d���}|�|dd�|�|dd�|�|dd�|�	|�
��|��}	|	d	��}
t|t
�rP|�d�}|�|
d
��d|�dS)
zU
        Pass a really big message to L{twisted.mail.bounce.generateBounce}.
        rrrrr
rrr�r�
N)rrrrrrrrrr&r'r(�
isinstance�bytes)r�header�message�ioTyperrrrrr)�innerMessagerrr �_bounceBigMessage]s
�


zBounceTests._bounceBigMessagecCs2d}|�|ddt�|�|�d�ddt�dS)zj
        L{twisted.mail.bounce.generateBounce} with big L{unicode} and
        L{bytes} messages.
        r#s
Test test
i'rz
More test
N)r3rrr)rr/rrr �test_bounceBigMessagepsz!BounceTests.test_bounceBigMessageN)	�__name__�
__module__�__qualname__�__doc__r!r%r*r3r4rrrr rsr)�
email.messager�email.parser�iorr�twisted.mailr�
twisted.trialr�TestCaserrrrr �<module>s

https://t.me/RX1948 - 2025