Ë
    oj  ã                   ó‚   — d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZ  G d	„ d
e	j                  «      Zy)z+
Test cases for L{twisted.logger._buffer}.
é    )ÚListÚcast)ÚBrokenMethodImplementation)ÚverifyObject)Úunittesté   )ÚLimitedHistoryLogObserver)ÚILogObserverÚLogEventc                   ó(   — e Zd ZdZdd„Zdd„Zdd„Zy)ÚLimitedHistoryLogObserverTestsz1
    Tests for L{LimitedHistoryLogObserver}.
    Nc                 óŠ   — t        d«      }	 t        t        |«       y# t        $ r}| j	                  |«       Y d}~yd}~ww xY w)zH
        L{LimitedHistoryLogObserver} provides L{ILogObserver}.
        r   N)r	   r   r
   r   Úfail)ÚselfÚobserverÚes      úA/usr/lib/python3/dist-packages/twisted/logger/test/test_buffer.pyÚtest_interfacez-LimitedHistoryLogObserverTests.test_interface   s:   € ô -¨QÓ/ˆð	Üœ xÕ0øÜ)ò 	Ø�I‰I�a�L‰Lûð	ús   � ž	A§=½Ac                 ó
  — d}t        |dz  «      D �cg c]  }t        |¬«      ‘Œ }}t        |«      }|D ]
  } ||«       Œ g }|j                  t	        t
        |j                  «      «       | j                  ||«       yc c}w )zY
        L{LimitedHistoryLogObserver} saves history in the order it is received.
        é   r   ©ÚnN©ÚrangeÚdictr	   ÚreplayTor   r
   ÚappendÚassertEqual©r   Úsizer   Úeventsr   ÚeventÚ	outEventss          r   Ú
test_orderz)LimitedHistoryLogObserverTests.test_order!   s€   € ð ˆÜ%*¨4°1©9Ó%5Ö6 ”$˜–)Ð6ˆÐ6Ü,¨TÓ2ˆàò 	ˆEÙ�U�Oð	ð %'ˆ	Ø×Ñœ$œ|¨Y×-=Ñ-=Ó>Ô?Ø×Ñ˜ Õ+ùò 7s   “B c                 ó  — d}t        |dz  «      D �cg c]  }t        |¬«      ‘Œ }}t        |«      }|D ]
  } ||«       Œ g }|j                  t	        t
        |j                  «      «       | j                  || d |«       yc c}w )z‰
        When more events than a L{LimitedHistoryLogObserver}'s maximum size are
        buffered, older events will be dropped.
        r   r   r   Nr   r   s          r   Ú
test_limitz)LimitedHistoryLogObserverTests.test_limit0   s‡   € ð
 ˆÜ%*¨4°!©8£_Ö5 ”$˜–)Ð5ˆÐ5Ü,¨TÓ2ˆàò 	ˆEÙ�U�Oð	ð %'ˆ	Ø×Ñœ$œ|¨Y×-=Ñ-=Ó>Ô?Ø×Ñ˜   ˜¨Õ3ùò 6s   “B)ÚreturnN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r&   © ó    r   r   r      s   „ ñóó,ô4r-   r   N)r+   Útypingr   r   Úzope.interface.exceptionsr   Úzope.interface.verifyr   Útwisted.trialr   Ú_bufferr	   Ú_interfacesr
   r   ÚTestCaser   r,   r-   r   ú<module>r5      s0   ðñ÷ å @Ý .å "Ý /ß 0ô,4 X×%6Ñ%6õ ,4r-   