%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/test/__pycache__/test_htb.cpython-312.pyc

�

Ϫ�f�����dddZddlmZddlmZddlmZGd�d	�ZGd
�dej�Z	Gd�d
ej�ZGd�de�ZGd�de�Z
Gd�de�Zy)z$Revision: 1.3 $�����)�htb)�unittest�)�
DummyConsumerc�,�eZdZdZdeddfd�Zdefd�Zy)�
DummyClockr�when�returnNc��||_y�N��time)�selfrs  �7/usr/lib/python3/dist-packages/twisted/test/test_htb.py�setzDummyClock.set
s	����	�c��|jSrr�rs r�__call__zDummyClock.__call__s���y�y�r)�__name__�
__module__�__qualname__r�intrr�rrr
r

s&���D�������#�rr
c��eZdZdZdZy)�
SomeBucket�d�N)rrr�maxburst�raterrrrrs���H��Drrc��eZdZdd�Zdd�Zy)�TestBucketBaseNc�v�tj|_t�|_|jt_yr)rr�
_realTimeFuncr
�clockrs r�setUpzTestBucketBase.setUps"�� �X�X����\��
��:�:��rc�.�|jt_yr)r&rrrs r�tearDownzTestBucketBase.tearDowns���%�%��r�rN)rrrr(r*rrrr$r$s���
&rr$c�$�eZdZdd�Zdd�Zdd�Zy)�BucketTestsNc�^�t�}|jd�}|jd|�y)z1
        Testing the size of the bucket.
        ��rN)r�add�assertEqual�r�b�fits   r�testBucketSizezBucketTests.testBucketSize$s(��
�L���e�e�D�k������c�"rc��t�}|jd�}|jjd�|jd�}|j	d|�y)z2
        Testing the bucket's drain rate.
        r/�
�N)rr0r'rr1r2s   r�testBucketDrainzBucketTests.testBucketDrain,sE��
�L���e�e�D�k���
�
���r���e�e�D�k������S�!rc�*�t�}|jd�|jjd�|j	�}|j|�|jjd�|j	�}|j
|�y)z\
        L{htb.Bucket.drip} returns C{True} if the bucket is empty after that drip.
        r8�	r7N)rr0r'r�drip�assertFalse�
assertTrue)rr3�emptys   r�test_bucketEmptyzBucketTests.test_bucketEmpty6sf��
�L��	���b�	��
�
���q�������������
�
���r�����������rr+)rrrr5r9r@rrrr-r-#s��#�"�rr-c�$�eZdZdd�Zdd�Zdd�Zy)�BucketNestingTestsNc��tj|�t�|_t|j�|_t|j�|_yr)r$r(r�parent�child1�child2rs rr(zBucketNestingTests.setUpEs9�����T�"� �l��� ����-��� ����-��rc��|jjd�|jjd�}|jd|�y)N�Zr7)rEr0rFr1�rr4s  r�testBucketParentSizez'BucketNestingTests.testBucketParentSizeKs4����������k�k�o�o�b�!������S�!rc���d|j_|jjd�|jjd�|jjd�}|j
d|�y)Nrrr7)rDr"rEr0r'rr1rIs  r�testBucketParentRatez'BucketNestingTests.testBucketParentRateQsR���������������
�
���r���k�k�o�o�c�"��
	
����S�!rr+)rrrr(rJrLrrrrBrBDs��.�"�"rrBc�$�eZdZdd�Zdd�Zdd�Zy)�ConsumerShaperTestsNc���tj|�t�|_t	�|_t
j|j|j
�|_yr)	r$r(r�
underlyingr�bucketr�ShapedConsumer�shapedrs rr(zConsumerShaperTests.setUpcs>�����T�"�'�/��� �l����(�(����$�+�+�F��rc�r�d}|jjd�|jjd�|jj|�|jj
�|jt|jj��||jjz�y)Nr7r�dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)rQr0rS�writer'r�resumeProducingr1�lenrP�getvaluer")r�delta_ts  r�testRatezConsumerShaperTests.testRateis|����������������)�$��
�
���w�����#�#�%�����T�_�_�5�5�7�8�'�D�K�K�DT�DT�:T�Urc���|j|jjd�|jj	�|j|jjd�y)Nrr)r1rQ�	_refcountrS�
stopProducingrs r�testBucketRefsz"ConsumerShaperTests.testBucketRefsssF��������.�.��2����!�!�#�������.�.��2rr+)rrrr(r[r_rrrrNrNbs��G�V�3rrNN)�__version__�twisted.protocolsr�
twisted.trialr�test_pcprr
�Bucketr�TestCaser$r-rBrNrrr�<module>rfsm��!��B�'��!�"�#���
����
�
&�X�&�&�&��.��B"��"�<3�.�3r

Zerion Mini Shell 1.0