Current File : //usr/lib/python3/dist-packages/twisted/mail/test/__pycache__/test_pop3.cpython-312.pyc |
�
Ϫ�f8� � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlZddlZddlZddlZddlZddlmZmZmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lm Z ddl!m"Z" ddl#m$Z$m%Z% G d� de$jL � Z' G d� dejP jR � Z* G d� d� Z+ G d� d� Z, G d� dejZ � Z. G d� de$j^ � Z0 G d� dejb � Z2 G d� de2� Z3 G d � d!ejh � Z5 G d"� d#e$j^ � Z6 eejn � G d$� d%� � Z8 G d&� d'� Z9d(� Z: G d)� d*e$j^ � Z; G d+� d,e$j^ � Z< G d-� d.� Z= G d/� d0e$j^ � Z> G d1� d2� Z?d3Z@ e%j� e@eB�4� ZCd5ZD e%j� eDeB�4� ZE G d6� d7e?e$j^ � ZF G d8� d9e?e$j^ � ZG G d:� d;e5� ZH G d<� d=eF� ZI G d>� d?eG� ZJ G d@� dAe5� ZK G dB� dCeF� ZL G dD� dEeG� ZM G dF� dGe$jL � ZN G dH� dIe$jL � ZO G dJ� dKe$jL � ZPy)Lz-
Test cases for L{twisted.mail.pop3} module.
� N)�OrderedDict)�md5)�BytesIO)�implementer)�verifyClass)�cred�internet�mail)�IUsernameHashedPassword)�defer)�LineSendingProtocol)�pop3)�loopback)�failure)�unittest�utilc �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) �UtilityTestszl
Test the various helper functions and classes used by the POP3 server
protocol implementation.
c �� � g }t t j g d�� � }t j |j
|d� }t |� }| j
|g � t |� | j
|g � t |� | j
|g � t |� | j
|g d�� t d� D ]
}t |� � | j
|g d�� y)z�
Test creating a LineBuffer and feeding it some lines. The lines should
build up in its internal buffer for a while and then get spat out to
the writer.
)�012�345�6�7�8�9� )r r r � )r r r r r r r r N) �iter� itertools�cycler �_IteratorBuffer�extend�assertEqual�next�range)�self�output�input�c�i�ns �=/usr/lib/python3/dist-packages/twisted/mail/test/test_pop3.py�test_LineBufferingzUtilityTests.test_LineBuffering( s� � � ���Y�_�_�%G�H�I��� � �����q�9����G�������$��Q�������$��Q�������$��Q������!4�5��q�� �A���G� �����!Q�R� c � � g }t g d�� }t j |j |d� }|D ] }� | j |g d�� y)z�
Test that a LineBuffer flushes everything when its iterator is
exhausted, and itself raises StopIteration.
)�a�br) r N)r r r! r"