§
    Ètºf	9  ã                   óþ   — d Z ddlZddlm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mZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ ddlmZmZ ddlmZ  G d„ dej        ¦  «        Z  G d„ dej        ¦  «        Z!dS )z+
Test cases for L{twisted.logger._legacy}.
é    N)Útime)ÚListÚcast)Úimplementer)ÚBrokenMethodImplementation)ÚverifyObject)ÚcontextÚlog)ÚFailure)Úunittesté   )ÚformatEvent)ÚILogObserverÚLogEvent)ÚLegacyLogObserverWrapperÚpublishToNewObserver)ÚLogLevelc                   óâ   — e Zd ZdZdd„Zdd„Zdedefd„Zdedefd„Zdd	„Z	dd
„Z
dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdedefd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚLegacyLogObserverWrapperTestsz0
    Tests for L{LegacyLogObserverWrapper}.
    ÚreturnNc                 óà   — t          t          j        d„ ¦  «        }t          |¦  «        }	 t	          t          |¦  «         dS # t
          $ r }|                      |¦  «         Y d}~dS d}~ww xY w)zD
        L{LegacyLogObserverWrapper} is an L{ILogObserver}.
        c                 ó   — d S ©N© )Úes    ú^/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/logger/test/test_legacy.pyú<lambda>z>LegacyLogObserverWrapperTests.test_interface.<locals>.<lambda>"   s   € À€ ó    N)r   Ú	legacyLogr   r   r   r   Úfail)ÚselfÚlegacyObserverÚobserverr   s       r   Útest_interfacez,LegacyLogObserverWrapperTests.test_interface   sz   € õ �iÔ4°n°nÑEÔEˆÝ+¨NÑ;Ô;ˆð	Ý� xÑ0Ô0Ð0Ð0Ð0øÝ)ð 	ð 	ð 	Ø�IŠI�a‰LŒLˆLˆLˆLˆLˆLˆLˆLøøøøð	øøøs   ¬A Á
A-ÁA(Á(A-c                 óÒ   — t          t          j        ¦  «         G d„ d¦  «        ¦   «         }t           |¦   «         ¦  «        }|                      t          |¦  «        d¦  «         dS )zJ
        L{LegacyLogObserverWrapper} returns the expected string.
        c                   ó4   — e Zd Zdefd„Zdej        ddfd„ZdS )ú?LegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserverr   c                 ó   — dS )Nz<Legacy Observer>r   ©r!   s    r   Ú__repr__zHLegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserver.__repr__0   s   € Ø*Ð*r   Ú	eventDictNc                 ó   — d S r   r   )r!   r+   s     r   Ú__call__zHLegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserver.__call__3   s   € Ø�r   )Ú__name__Ú
__module__Ú__qualname__Ústrr*   r   Ú	EventDictr-   r   r   r   ÚLegacyObserverr'   .   sT   € € € € € ð+ #ð +ð +ð +ð +ð¨)Ô*=ð À$ð ð ð ð ð ð r   r3   z+LegacyLogObserverWrapper(<Legacy Observer>)N)r   r   r   r   ÚassertEqualÚrepr)r!   r3   r#   s      r   Ú	test_reprz'LegacyLogObserverWrapperTests.test_repr)   s|   € õ
 
•YÔ+Ñ	,Ô	,ð	ð 	ð 	ð 	ð 	ñ 	ô 	ñ 
-Ô	,ð	õ ,¨N¨NÑ,<Ô,<Ñ=Ô=ˆà×Ò�˜h™œÐ)VÑWÔWÐWÐWÐWr   Úeventc                 óÌ   ‡— g Št          t          j        ˆfd„¦  «        }t          |¦  «        } ||¦  «         |                      t          ‰¦  «        d¦  «         ‰d         S )zÒ
        Send an event to a wrapped legacy observer and capture the event as
        seen by that observer.

        @param event: an event

        @return: the event as observed by the legacy wrapper
        c                 ó.   •— ‰                      | ¦  «        S r   )Úappend)r   Úeventss    €r   r   z7LegacyLogObserverWrapperTests.observe.<locals>.<lambda>E   s   ø€ ÀÇÂÈaÑ@PÔ@P€ r   é   r   )r   r   r   r   r4   Úlen)r!   r7   r"   r#   r;   s       @r   Úobservez%LegacyLogObserverWrapperTests.observe:   sf   ø€ ð "$ˆå�iÔ4Ð6PÐ6PÐ6PÐ6PÑQÔQˆÝ+¨NÑ;Ô;ˆØˆ�‰ŒˆØ×Ò�˜V™œ aÑ(Ô(Ð(à�aŒyÐr   c                 óZ  — |                      dt          ¦   «         ¦  «         |                      dd¦  «         |                      dt          j        ¦  «         |                      t          |¦  «        ¦  «        }|                     ¦   «         D ]\  }}|                      ||¦  «         Œ|S )zÉ
        Send an event to a wrapped legacy observer and verify that its data is
        preserved.

        @param event: an event

        @return: the event as observed by the legacy wrapper
        Úlog_timeÚ
log_systemú-Ú	log_level)Ú
setdefaultr   r   Úinfor>   ÚdictÚitemsÚassertIn)r!   r7   ÚobservedÚkeyÚvalues        r   ÚforwardAndVerifyz.LegacyLogObserverWrapperTests.forwardAndVerifyL   sž   € ð 	×Ò˜¥T¡V¤VÑ,Ô,Ð,Ø×Ò˜ sÑ+Ô+Ð+Ø×Ò˜¥h¤mÑ4Ô4Ð4ð —<’<¥ U¡¤Ñ,Ô,ˆð  Ÿ+š+™-œ-ð 	)ð 	)‰JˆC�Ø�MŠM˜#˜xÑ(Ô(Ð(Ð(àˆr   c                 óN   — |                       t          dd¬¦  «        ¦  «         dS )ze
        Basic forwarding: event keys as observed by a legacy observer are the
        same.
        r<   r   ©ÚfooÚbarN)rL   rF   r)   s    r   Útest_forwardz*LegacyLogObserverWrapperTests.test_forwardc   s+   € ð
 	×Ò�d q¨aÐ0Ñ0Ô0Ñ1Ô1Ð1Ð1Ð1r   c                 ó    — t          ¦   «         }|                      t          |¬¦  «        ¦  «        }|                      |d         |¦  «         dS )zc
        The new-style C{"log_time"} key is copied to the old-style C{"time"}
        key.
        )r@   r   N©r   rL   rF   r4   ©r!   Ústampr7   s      r   Ú	test_timez'LegacyLogObserverWrapperTests.test_timej   sK   € õ
 ‘”ˆØ×%Ò%¥d°EÐ&:Ñ&:Ô&:Ñ;Ô;ˆØ×Ò˜˜vœ¨Ñ.Ô.Ð.Ð.Ð.r   c                 ó¨   — t          ¦   «         }|                      t          |dz   |¬¦  «        ¦  «        }|                      |d         |¦  «         dS )zr
        The new-style C{"log_time"} key does not step on a pre-existing
        old-style C{"time"} key.
        r<   )r@   r   r   NrS   rT   s      r   Útest_timeAlreadySetz1LegacyLogObserverWrapperTests.test_timeAlreadySets   sQ   € õ
 ‘”ˆØ×%Ò%¥d°E¸A±IÀEÐ&JÑ&JÔ&JÑKÔKˆØ×Ò˜˜vœ¨Ñ.Ô.Ð.Ð.Ð.r   c                 ó„   — |                       t          d¬¦  «        ¦  «        }|                      |d         d¦  «         dS )zg
        The new-style C{"log_system"} key is copied to the old-style
        C{"system"} key.
        rO   )rA   ÚsystemN©rL   rF   r4   ©r!   r7   s     r   Útest_systemz)LegacyLogObserverWrapperTests.test_system|   sB   € ð
 ×%Ò%¥d°eÐ&<Ñ&<Ô&<Ñ=Ô=ˆØ×Ò˜˜xœ¨%Ñ0Ô0Ð0Ð0Ð0r   c                 ó†   — |                       t          dd¬¦  «        ¦  «        }|                      |d         d¦  «         dS )zv
        The new-style C{"log_system"} key does not step on a pre-existing
        old-style C{"system"} key.
        rO   rP   )rA   rZ   rZ   Nr[   r\   s     r   Útest_systemAlreadySetz3LegacyLogObserverWrapperTests.test_systemAlreadySet„   sD   € ð
 ×%Ò%¥d°eÀEÐ&JÑ&JÔ&JÑKÔKˆØ×Ò˜˜xœ¨%Ñ0Ô0Ð0Ð0Ð0r   c                 óÐ   — t          t          ¦   «         t          j        ¬¦  «        }|                      t          |¦  «        ¦  «        }|                      |d         d¦  «         dS )zy
        If the new-style C{"log_system"} key is absent, the old-style
        C{"system"} key is set to C{"-"}.
        )r@   rC   rZ   rB   N)rF   r   r   rE   r>   r4   )r!   r7   rI   s      r   Útest_noSystemz+LegacyLogObserverWrapperTests.test_noSystemŒ   sT   € õ �d™fœfµ´Ð>Ñ>Ô>ˆØ—<’<¥ U¡¤Ñ,Ô,ˆØ×Ò˜ (Ô+¨SÑ1Ô1Ð1Ð1Ð1r   c                 óv  — |                       t          t          j        d¬¦  «        ¦  «         |                       t          t          j        d¬¦  «        ¦  «         |                       t          t          j        d¬¦  «        ¦  «         |                       t          t          j        d¬¦  «        ¦  «         dS )zÁ
        If explicitly set, the C{isError} key will be preserved when forwarding
        from a new-style logging emitter to a legacy logging observer,
        regardless of log level.
        r<   )rC   ÚisErrorr   N)rL   rF   r   rE   ÚwarnÚerrorÚcriticalr)   s    r   Útest_levelNotChangez1LegacyLogObserverWrapperTests.test_levelNotChange–   s—   € ð 	×Ò�d­X¬]ÀAÐFÑFÔFÑGÔGÐGØ×Ò�d­X¬]ÀAÐFÑFÔFÑGÔGÐGØ×Ò�d­X¬^ÀQÐGÑGÔGÑHÔHÐHØ×Ò�d­XÔ->ÈÐJÑJÔJÑKÔKÐKÐKÐKr   c                 óŒ   — |                       t          t          j        ¬¦  «        ¦  «        }|                      d|¦  «         dS )a)  
        The new-style C{"log_level"} key is not translated to the old-style
        C{"logLevel"} key.

        Events are forwarded from the old module from to new module and are
        then seen by old-style observers.
        We don't want to add unexpected keys to old-style events.
        )rC   ÚlogLevelN)rL   rF   r   rE   ÚassertNotInr\   s     r   Útest_pythonLogLevelNotSetz7LegacyLogObserverWrapperTests.test_pythonLogLevelNotSet¡   s@   € ð ×%Ò%¥dµX´]Ð&CÑ&CÔ&CÑDÔDˆØ×Ò˜ UÑ+Ô+Ð+Ð+Ð+r   c                 ó„   — |                       t          d¬¦  «        ¦  «        }|                      |d         d¦  «         dS )a  
        If a stdlib log level was provided as a string (eg. C{"WARNING"}) in
        the legacy "logLevel" key, it does not get converted to a number.
        The documentation suggested that numerical values should be used but
        this was not a requirement.
        ÚWARNING©ri   ri   Nr[   r\   s     r   Útest_stringPythonLogLevelz7LegacyLogObserverWrapperTests.test_stringPythonLogLevel­   sQ   € ð ×%Ò%ÝØ"ðñ ô ñ
ô 
ˆð
 	×Ò˜˜zÔ*¨IÑ6Ô6Ð6Ð6Ð6r   c                 ó€   — |                       t          ¦   «         ¦  «        }|                      |d         d¦  «         dS )z–
        The old-style C{"message"} key is added, even if no new-style
        C{"log_format"} is given, as it is required, but may be empty.
        Úmessager   Nr[   r\   s     r   Útest_messagez*LegacyLogObserverWrapperTests.test_message»   s<   € ð
 ×%Ò%¥d¡f¤fÑ-Ô-ˆØ×Ò˜˜yÔ)¨2Ñ.Ô.Ð.Ð.Ð.r   c                 ó„   — |                       t          d¬¦  «        ¦  «        }|                      |d         d¦  «         dS )zV
        The old-style C{"message"} key is not modified if it already exists.
        rN   )rq   rq   Nr[   r\   s     r   Útest_messageAlreadySetz4LegacyLogObserverWrapperTests.test_messageAlreadySetÃ   sC   € ð ×%Ò%¥d°>Ð&BÑ&BÔ&BÑCÔCˆØ×Ò˜˜yÔ)¨>Ñ:Ô:Ð:Ð:Ð:r   c                 óž   — |                       t          dd¬¦  «        ¦  «        }|                      t          j        |¦  «        d¦  «         dS )z—
        Formatting is translated such that text is rendered correctly, even
        though old-style logging doesn't use PEP 3101 formatting.
        zHello, {who}!Úworld)Ú
log_formatÚwhoúHello, world!N©rL   rF   r4   r   ÚtextFromEventDictr\   s     r   Útest_formatz)LegacyLogObserverWrapperTests.test_formatÊ   sK   € ð
 ×%Ò%¥d°oÈ7Ð&SÑ&SÔ&SÑTÔTˆØ×Ò�Ô4°UÑ;Ô;¸_ÑMÔMÐMÐMÐMr   c                 óž   — |                       t          dd¬¦  «        ¦  «        }|                      t          j        |¦  «        d¦  «         dS )zo
        Using the message key, which is special in old-style, works for
        new-style formatting.
        zHello, {message}!rv   )rw   rq   ry   Nrz   r\   s     r   Útest_formatMessagez0LegacyLogObserverWrapperTests.test_formatMessageÒ   sS   € ð
 ×%Ò%ÝÐ/¸ÐAÑAÔAñ
ô 
ˆð 	×Ò�Ô4°UÑ;Ô;¸_ÑMÔMÐMÐMÐMr   c                 óž   — |                       t          dd¬¦  «        ¦  «        }|                      t          j        |¦  «        d¦  «         dS )zd
        Formatting is not altered if the old-style C{"format"} key already
        exists.
        zHello!zHowdy!)rw   ÚformatNrz   r\   s     r   Útest_formatAlreadySetz3LegacyLogObserverWrapperTests.test_formatAlreadySetÜ   sK   € ð
 ×%Ò%¥d°hÀxÐ&PÑ&PÔ&PÑQÔQˆØ×Ò�Ô4°UÑ;Ô;¸XÑFÔFÐFÐFÐFr   Úvaluesc                 ó~   — t          t          d¦  «        ¦  «        }|                      t          d|ddœ|¤Ž¦  «        S )z¦
        Create a new-style event with a captured failure.

        @param values: Additional values to include in the event.

        @return: the new event
        znyargh!ú	oopsie...)Úlog_failurerw   r   )r   ÚRuntimeErrorrL   rF   )r!   r‚   Úfailures      r   ÚeventWithFailurez.LegacyLogObserverWrapperTests.eventWithFailureä   sI   € õ �, yÑ1Ô1Ñ2Ô2ˆØ×$Ò$ÝÐG˜W°ÐGÐGÀÐGÐGñ
ô 
ð 	
r   c                 óà   — |                       ¦   «         }|                      |d         |d         ¦  «         |                      |d         ¦  «         |                      |d         d¦  «         dS )z}
        Captured failures in the new style set the old-style C{"failure"},
        C{"isError"}, and C{"why"} keys.
        r‡   r…   rc   Úwhyr„   N)rˆ   ÚassertIsÚ
assertTruer4   r\   s     r   Útest_failurez*LegacyLogObserverWrapperTests.test_failureñ   sj   € ð
 ×%Ò%Ñ'Ô'ˆØ�Š�e˜IÔ&¨¨mÔ(<Ñ=Ô=Ð=Ø�Š˜˜iÔ(Ñ)Ô)Ð)Ø×Ò˜˜uœ {Ñ3Ô3Ð3Ð3Ð3r   c                 ó¢   — t          t          d¦  «        ¦  «        }|                      |¬¦  «        }|                      |d         |¦  «         dS )úv
        Captured failures in the new style do not step on a pre-existing
        old-style C{"failure"} key.
        zWeak salsa!)r‡   r‡   N)r   r†   rˆ   r‹   )r!   r‡   r7   s      r   Útest_failureAlreadySetz4LegacyLogObserverWrapperTests.test_failureAlreadySetû   sN   € õ
 �, }Ñ5Ô5Ñ6Ô6ˆØ×%Ò%¨gÐ%Ñ6Ô6ˆØ�Š�e˜IÔ&¨Ñ0Ô0Ð0Ð0Ð0r   c                 ój   — |                       d¬¦  «        }|                      |d         d¦  «         dS )zv
        Captured failures in the new style do not step on a pre-existing
        old-style C{"isError"} key.
        r   ©rc   rc   N©rˆ   r4   r\   s     r   Útest_isErrorAlreadySetz4LegacyLogObserverWrapperTests.test_isErrorAlreadySet  s;   € ð
 ×%Ò%¨aÐ%Ñ0Ô0ˆØ×Ò˜˜yÔ)¨1Ñ-Ô-Ð-Ð-Ð-r   c                 ój   — |                       d¬¦  «        }|                      |d         d¦  «         dS )r�   Úblah)rŠ   rŠ   Nr“   r\   s     r   Útest_whyAlreadySetz0LegacyLogObserverWrapperTests.test_whyAlreadySet  s:   € ð
 ×%Ò%¨&Ð%Ñ1Ô1ˆØ×Ò˜˜uœ vÑ.Ô.Ð.Ð.Ð.r   ©r   N)r.   r/   r0   Ú__doc__r$   r6   r   r>   rL   rQ   rV   rX   r]   r_   ra   rg   rk   ro   rr   rt   r|   r~   r�   Úobjectrˆ   r�   r�   r”   r—   r   r   r   r   r      s(  € € € € € ðð ð	ð 	ð 	ð 	ðXð Xð Xð Xð"˜Xð ¨(ð ð ð ð ð$ hð °8ð ð ð ð ð.2ð 2ð 2ð 2ð/ð /ð /ð /ð/ð /ð /ð /ð1ð 1ð 1ð 1ð1ð 1ð 1ð 1ð2ð 2ð 2ð 2ð	Lð 	Lð 	Lð 	Lð
,ð 
,ð 
,ð 
,ð7ð 7ð 7ð 7ð/ð /ð /ð /ð;ð ;ð ;ð ;ðNð Nð Nð NðNð Nð Nð NðGð Gð Gð Gð
¨ð 
°Hð 
ð 
ð 
ð 
ð4ð 4ð 4ð 4ð1ð 1ð 1ð 1ð.ð .ð .ð .ð/ð /ð /ð /ð /ð /r   r   c                   óˆ   — e Zd ZdZdd„Zdededej        fd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS )ÚPublishToNewObserverTestsz,
    Tests for L{publishToNewObserver}.
    r   Nc                 ó\   — g | _         t          t          | j         j        ¦  «        | _        d S r   )r;   r   r   r:   r#   r)   s    r   ÚsetUpzPublishToNewObserverTests.setUp  s#   € Ø&(ˆŒÝ�\¨4¬;Ô+=Ñ>Ô>ˆŒˆˆr   rq   r‚   c                 óÒ   — t          j        t          j        ¦  «        pi                      ¦   «         }|                     |¦  «         ||d<   t          ¦   «         |d<   d|vrd|d<   |S )a  
        Return a basic old-style event as would be created by L{legacyLog.msg}.

        @param message: a message event value in the legacy event format
        @param values: additional event values in the legacy event format

        @return: a legacy event
        rq   r   rc   r   )r	   Úgetr   ÚILogContextÚcopyÚupdater   )r!   rq   r‚   r7   s       r   ÚlegacyEventz%PublishToNewObserverTests.legacyEvent  sj   € õ ”�YÔ2Ñ3Ô3Ð9°r×?Ò?ÑAÔAˆØ�Š�VÑÔÐØ"ˆˆiÑÝ™œˆˆf‰Ø˜EÐ!Ð!Ø ˆE�)ÑØˆr   c                 óº   — t          | j        |                      ¦   «         t          j        ¦  «         |                      t          | j        ¦  «        d¦  «         dS )z6
        The observer is called exactly once.
        r<   N)r   r#   r¤   r   r{   r4   r=   r;   r)   s    r   Útest_observedz'PublishToNewObserverTests.test_observed/  sV   € õ 	ØŒM˜4×+Ò+Ñ-Ô-­yÔ/Jñ	
ô 	
ð 	
ð 	×Ò�˜Tœ[Ñ)Ô)¨1Ñ-Ô-Ð-Ð-Ð-r   c                 óÚ   — t          | j        |                      ¦   «         t          j        ¦  «         |                      | j        d         d         | j        d         d         ¦  «         dS )zc
        The old-style C{"time"} key is copied to the new-style C{"log_time"}
        key.
        r   r@   r   N©r   r#   r¤   r   r{   r4   r;   r)   s    r   rV   z#PublishToNewObserverTests.test_time8  sb   € õ
 	ØŒM˜4×+Ò+Ñ-Ô-­yÔ/Jñ	
ô 	
ð 	
ð 	×Ò˜œ Qœ¨
Ô3°T´[À´^ÀFÔ5KÑLÔLÐLÐLÐLr   c                 óô   — dt           dt          fd„}|                      dd¦  «        } ||¦  «        }t          | j        ||¦  «         |                      t          | j        d         ¦  «        |¦  «         dS )z—
        A published old-style event should format as text in the same way as
        the given C{textFromEventDict} callable would format it.
        r7   r   c                 óx   — d                      t          d                      | d         ¦  «        ¦  «        ¦  «        S )NÚ ú rq   )ÚjoinÚreversed)r7   s    r   r{   zAPublishToNewObserverTests.test_message.<locals>.textFromEventDictH  s-   € Ø—7’7�8 C§H¢H¨U°9Ô-=Ñ$>Ô$>Ñ?Ô?Ñ@Ô@Ð@r   zHello,zworld!r   N)r   r1   r¤   r   r#   r4   r   r;   )r!   r{   r7   Útexts       r   rr   z&PublishToNewObserverTests.test_messageB  s�   € ð	A¥Xð 	Aµ#ð 	Að 	Að 	Að 	Að × Ò  ¨8Ñ4Ô4ˆØ Ð  Ñ'Ô'ˆå˜Tœ]¨EÐ3DÑEÔEÐEØ×Ò� T¤[°¤^Ñ4Ô4°dÑ;Ô;Ð;Ð;Ð;r   c                 óÌ   — t          | j        |                      ¦   «         t          j        ¦  «         |                      | j        d         d         t          j        ¦  «         dS )zL
        Published event should have log level of L{LogLevel.info}.
        r   rC   N)	r   r#   r¤   r   r{   r4   r;   r   rE   r)   s    r   Útest_defaultLogLevelz.PublishToNewObserverTests.test_defaultLogLevelQ  sY   € õ 	ØŒM˜4×+Ò+Ñ-Ô-­yÔ/Jñ	
ô 	
ð 	
ð 	×Ò˜œ Qœ¨Ô4µh´mÑDÔDÐDÐDÐDr   c                 óÐ   — t          | j        |                      d¬¦  «        t          j        ¦  «         |                      | j        d         d         t          j        ¦  «         dS )z“
        If C{"isError"} is set to C{1} (true) on the legacy event, the
        C{"log_level"} key should get set to L{LogLevel.critical}.
        r<   r’   r   rC   N)	r   r#   r¤   r   r{   r4   r;   r   rf   r)   s    r   Útest_isErrorz&PublishToNewObserverTests.test_isErrorZ  s_   € õ
 	ØŒM˜4×+Ò+°AÐ+Ñ6Ô6½	Ô8Sñ	
ô 	
ð 	
ð 	×Ò˜œ Qœ¨Ô4µhÔ6GÑHÔHÐHÐHÐHr   c                 óä   — t          | j        |                      t          j        ¬¦  «        t
          j        ¦  «         |                      | j        d         d         t          j
        ¦  «         dS )zæ
        If the old-style C{"logLevel"} key is set to a standard library logging
        level, using a predefined (L{int}) constant, the new-style
        C{"log_level"} key should get set to the corresponding log level.
        rn   r   rC   N)r   r#   r¤   Ú
py_loggingrm   r   r{   r4   r;   r   rd   r)   s    r   Útest_stdlibLogLevelz-PublishToNewObserverTests.test_stdlibLogLeveld  sc   € õ 	ØŒMØ×Ò¥jÔ&8ÐÑ9Ô9ÝÔ'ñ	
ô 	
ð 	
ð
 	×Ò˜œ Qœ¨Ô4µh´mÑDÔDÐDÐDÐDr   c                 óÐ   — t          | j        |                      d¬¦  «        t          j        ¦  «         |                      | j        d         d         t          j        ¦  «         dS )zÖ
        If the old-style C{"logLevel"} key is set to a standard library logging
        level, using a string value, the new-style C{"log_level"} key should
        get set to the corresponding log level.
        rm   rn   r   rC   N)	r   r#   r¤   r   r{   r4   r;   r   rd   r)   s    r   Útest_stdlibLogLevelWithStringz7PublishToNewObserverTests.test_stdlibLogLevelWithStringq  s`   € õ 	ØŒMØ×Ò iÐÑ0Ô0ÝÔ'ñ	
ô 	
ð 	
ð
 	×Ò˜œ Qœ¨Ô4µh´mÑDÔDÐDÐDÐDr   c                 ó°   — t          | j        |                      d¬¦  «        t          j        ¦  «         |                      d| j        d         ¦  «         dS )z½
        If the old-style C{"logLevel"} key is set to a standard library logging
        level, using an unknown value, the new-style C{"log_level"} key should
        not get set.
        zFoo!!!!!rn   rC   r   N)r   r#   r¤   r   r{   rj   r;   r)   s    r   Útest_stdlibLogLevelWithGarbagez8PublishToNewObserverTests.test_stdlibLogLevelWithGarbage~  sY   € õ 	ØŒMØ×Ò jÐÑ1Ô1ÝÔ'ñ	
ô 	
ð 	
ð
 	×Ò˜ d¤k°!¤nÑ5Ô5Ð5Ð5Ð5r   c                 ó¸   — t          | j        |                      ¦   «         t          j        ¦  «         |                      | j        d         d         d¦  «         dS )z‹
        Published event should have a namespace of C{"log_legacy"} to indicate
        that it was forwarded from legacy logging.
        r   Úlog_namespaceÚ
log_legacyNr¨   r)   s    r   Útest_defaultNamespacez/PublishToNewObserverTests.test_defaultNamespace‹  sW   € õ
 	ØŒM˜4×+Ò+Ñ-Ô-­yÔ/Jñ	
ô 	
ð 	
ð 	×Ò˜œ Qœ¨Ô8¸,ÑGÔGÐGÐGÐGr   c                 óÚ   — t          | j        |                      ¦   «         t          j        ¦  «         |                      | j        d         d         | j        d         d         ¦  «         dS )zg
        The old-style C{"system"} key is copied to the new-style
        C{"log_system"} key.
        r   rA   rZ   Nr¨   r)   s    r   r]   z%PublishToNewObserverTests.test_system•  sb   € õ
 	ØŒM˜4×+Ò+Ñ-Ô-­yÔ/Jñ	
ô 	
ð 	
ð 	×Ò˜œ Qœ¨Ô5°t´{À1´~ÀhÔ7OÑPÔPÐPÐPÐPr   r˜   )r.   r/   r0   r™   rž   r1   rš   r   r2   r¤   r¦   rV   rr   r±   r³   r¶   r¸   rº   r¾   r]   r   r   r   rœ   rœ     sD  € € € € € ðð ð?ð ?ð ?ð ?ð Cð °6ð ¸iÔ>Qð ð ð ð ð".ð .ð .ð .ðMð Mð Mð Mð<ð <ð <ð <ðEð Eð Eð EðIð Ið Ið IðEð Eð Eð EðEð Eð Eð Eð6ð 6ð 6ð 6ðHð Hð Hð HðQð Qð Qð Qð Qð Qr   rœ   )"r™   Úloggingrµ   r   Útypingr   r   Úzope.interfacer   Úzope.interface.exceptionsr   Úzope.interface.verifyr   Útwisted.pythonr	   r
   r   Útwisted.python.failurer   Útwisted.trialr   Ú_formatr   Ú_interfacesr   r   Ú_legacyr   r   Ú_levelsr   ÚTestCaser   rœ   r   r   r   ú<module>rÍ      sŽ  ððð ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &Ø @Ð @Ð @Ð @Ð @Ð @Ø .Ð .Ð .Ð .Ð .Ð .à 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø *Ð *Ð *Ð *Ð *Ð *Ø "Ð "Ð "Ð "Ð "Ð "Ø !Ð !Ð !Ð !Ð !Ð !Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø DÐ DÐ DÐ DÐ DÐ DÐ DÐ DØ Ð Ð Ð Ð Ð ðy/ð y/ð y/ð y/ð y/ HÔ$5ñ y/ô y/ð y/ðxHQð HQð HQð HQð HQ Ô 1ñ HQô HQð HQð HQð HQr   