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/logger/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�b�@sjdZddlmZmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZGd	d
�d
e	j�ZdS)z+
Test cases for L{twisted.logger._buffer}.
�)�List�cast)�BrokenMethodImplementation)�verifyObject)�unittest�)�LimitedHistoryLogObserver)�ILogObserver�LogEventc@s.eZdZdZd
dd�Zd
dd�Zd
dd	�ZdS)�LimitedHistoryLogObserverTestsz1
    Tests for L{LimitedHistoryLogObserver}.
    �returnNc
CsJtd�}ztt|�WdSty$}z|�|�WYd}~dSd}~ww)zH
        L{LimitedHistoryLogObserver} provides L{ILogObserver}.
        rN)rrr	r�fail)�self�observer�e�r�A/usr/lib/python3/dist-packages/twisted/logger/test/test_buffer.py�test_interfaces��z-LimitedHistoryLogObserverTests.test_interfacecCsZd}dd�t|d�D�}t|�}|D]}||�qg}|�tt|j��|�||�dS)zY
        L{LimitedHistoryLogObserver} saves history in the order it is received.
        �cS�g|]}t|d��qS�)�n��dict��.0rrrr�
<listcomp>&�z=LimitedHistoryLogObserverTests.test_order.<locals>.<listcomp>rN��ranger�replayTorr	�append�assertEqual�r�size�eventsr�event�	outEventsrrr�
test_order!s
z)LimitedHistoryLogObserverTests.test_ordercCsdd}dd�t|d�D�}t|�}|D]}||�qg}|�tt|j��|�||d�|�dS)z�
        When more events than a L{LimitedHistoryLogObserver}'s maximum size are
        buffered, older events will be dropped.
        rcSrrrrrrrr6rz=LimitedHistoryLogObserverTests.test_limit.<locals>.<listcomp>rNrr#rrr�
test_limit0s
z)LimitedHistoryLogObserverTests.test_limit)rN)�__name__�
__module__�__qualname__�__doc__rr(r)rrrrrs



rN)r-�typingrr�zope.interface.exceptionsr�zope.interface.verifyr�
twisted.trialr�_bufferr�_interfacesr	r
�TestCaserrrrr�<module>s

https://t.me/RX1948 - 2025