+
    üÐj	9  ã                   ó  € R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ R	IHt ^R
IHt ^RIHtHt ^RIHtHt ^RIHt  ! R R]P>                  4      t  ! R R]P>                  4      t!R# )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                   óÂ  a € ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R  lR! ltV 3R" lR# ltV 3R$ lR% ltV 3R& lR' ltV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltV 3R. lR/ ltR0tV tR1# )2ÚLegacyLogObserverWrapperTestsz(
Tests for L{LegacyLogObserverWrapper}.
c                ó   <€ V ^8„  d   QhRR/# ©é   ÚreturnN© )ÚformatÚ__classdict__s   "€ÚA/usr/lib/python3/dist-packages/twisted/logger/test/test_legacy.pyÚ__annotate__Ú*LegacyLogObserverWrapperTests.__annotate__   s   ø€ ÷ 	ñ 	 ñ 	ó    c                óÈ   € \        \        P                  R 4      p\        V4      p \	        \        V4       R#   \
         d   pT P                  T4        Rp?R# Rp?ii ; i)z4
L{LegacyLogObserverWrapper} is an L{ILogObserver}.
c                 ó   € R # ©Nr   )Úes   &r   Ú<lambda>Ú>LegacyLogObserverWrapperTests.test_interface.<locals>.<lambda>"   s   € Ár   N)r   Ú	legacyLogr   r   r   r   Úfail)ÚselfÚlegacyObserverÚobserverr"   s   &   r   Útest_interfaceÚ,LegacyLogObserverWrapperTests.test_interface   sL   € ô œi×4Ñ4±nÓEˆÜ+¨NÓ;ˆð	Üœ xÖ0øÜ)ô 	Ø�I‰I�a�LŠLûð	ús   ¨: ºA!ÁAÁA!c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   )   s   ø€ ÷ Xñ X˜4ñ Xr   c                ó¨   € \        \        P                  4       ! R R4      4       p\        V! 4       4      pV P	                  \        V4      R4       R# )z:
L{LegacyLogObserverWrapper} returns the expected string.
c                   óD   a € ] tR t^.t o V 3R lR ltV 3R lR ltRtV tR# )Ú?LegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserverc                ó    <€ V ^8„  d   QhRS[ /# )r   r   )Ústr)r   r   s   "€r   r   ÚLLegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserver.__annotate__0   s   ø€ ÷ +ñ +¡#ñ +r   c                ó   € R # )z<Legacy Observer>r   ©r'   s   &r   Ú__repr__ÚHLegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserver.__repr__0   s   € Ù*r   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r   Ú	eventDictr   N)r%   Ú	EventDict)r   r   s   "€r   r   r2   3   s!   ø€ ÷ ñ ©)×*=Ñ*=ð À$ñ r   c                ó   € R # r!   r   )r'   r8   s   &&r   Ú__call__ÚHLegacyLogObserverWrapperTests.test_repr.<locals>.LegacyObserver.__call__3   s   € Ùr   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r5   r;   Ú__static_attributes__Ú__classdictcell__©r   s   @r   ÚLegacyObserverr/   .   s   ø‡ € ÷+ð +÷ö r   rD   z+LegacyLogObserverWrapper(<Legacy Observer>)N)r   r%   r   r   ÚassertEqualÚrepr)r'   rD   r)   s   &  r   Ú	test_reprÚ'LegacyLogObserverWrapperTests.test_repr)   sJ   € ô
 
”Y×+Ñ+Ó	,÷	ð 	ó 
-ð	ô ,©NÓ,<Ó=ˆà×Ñœ˜h›Ð)VÖWr   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# ©r   Úeventr   ©r   )r   r   s   "€r   r   r   :   s   ø€ ÷ ñ ™Xð ©(ñ r   c                ó²   a€ . o\        \        P                  V3R l4      p\        V4      pV! V4       V P	                  \        S4      ^4       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P                  V 4      # r!   )Úappend)r"   Úeventss   &€r   r#   Ú7LegacyLogObserverWrapperTests.observe.<locals>.<lambda>E   s   ø€ ÀÇÁÈaÔ@Pr   )r   r%   r   r   rE   Úlen)r'   rK   r(   r)   rP   s   &&  @r   ÚobserveÚ%LegacyLogObserverWrapperTests.observe:   sL   ø€ ð "$ˆäœi×4Ñ4Ô6PÓQˆÜ+¨NÓ;ˆÙ�ŒØ×Ñœ˜V› aÔ(à�a�yÐr   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# rJ   rL   )r   r   s   "€r   r   r   L   s   ø€ ÷ ñ ¡hð ±8ñ r   c                ó&  € VP                  R\        4       4       VP                  RR4       VP                  R\        P                  4       V P	                  \        V4      4      pVP                  4        F  w  r4V P                  W24       K  	  V# )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   ÚinforS   ÚdictÚitemsÚassertIn)r'   rK   ÚobservedÚkeyÚvalues   &&   r   ÚforwardAndVerifyÚ.LegacyLogObserverWrapperTests.forwardAndVerifyL   su   € ð 	×Ñ˜¤T£VÔ,Ø×Ñ˜ sÔ+Ø×Ñ˜¤h§m¡mÔ4ð —<‘<¤ U£Ó,ˆð  Ÿ+™+ž-‰JˆCØ�M‰M˜#Ö(ñ (ð ˆr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   c   s   ø€ ÷ 2ñ 2˜dñ 2r   c                ó>   € V P                  \        ^^R7      4       R# )zM
Basic forwarding: event keys as observed by a legacy observer are the
same.
©ÚfooÚbarN)rc   r]   r4   s   &r   Útest_forwardÚ*LegacyLogObserverWrapperTests.test_forwardc   s   € ð
 	×Ñœd q¨aÔ0Ö1r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   j   s   ø€ ÷ /ñ /˜4ñ /r   c                ó‚   € \        4       pV P                  \        VR7      4      pV P                  VR,          V4       R# )zK
The new-style C{"log_time"} key is copied to the old-style C{"time"}
key.
)rW   r   N©r   rc   r]   rE   ©r'   ÚstamprK   s   &  r   Ú	test_timeÚ'LegacyLogObserverWrapperTests.test_timej   s4   € ô
 “ˆØ×%Ñ%¤d°EÔ&:Ó;ˆØ×Ñ˜˜v�¨Ö.r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   s   s   ø€ ÷ /ñ / Tñ /r   c                ó’   € \        4       pV P                  \        V^,           VR7      4      pV P                  VR,          V4       R# )zZ
The new-style C{"log_time"} key does not step on a pre-existing
old-style C{"time"} key.
)rW   r   r   Nrn   ro   s   &  r   Útest_timeAlreadySetÚ1LegacyLogObserverWrapperTests.test_timeAlreadySets   s:   € ô
 “ˆØ×%Ñ%¤d°E¸AµIÀEÔ&JÓKˆØ×Ñ˜˜v�¨Ö.r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   |   s   ø€ ÷ 1ñ 1˜Tñ 1r   c                ón   € V P                  \        RR7      4      pV P                  VR,          R4       R# )zO
The new-style C{"log_system"} key is copied to the old-style
C{"system"} key.
rh   )rX   ÚsystemN©rc   r]   rE   ©r'   rK   s   & r   Útest_systemÚ)LegacyLogObserverWrapperTests.test_system|   s-   € ð
 ×%Ñ%¤d°eÔ&<Ó=ˆØ×Ñ˜˜x�¨%Ö0r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   „   s   ø€ ÷ 1ñ 1 tñ 1r   c                óp   € V P                  \        RRR7      4      pV P                  VR,          R4       R# )z^
The new-style C{"log_system"} key does not step on a pre-existing
old-style C{"system"} key.
rh   ri   )rX   ry   ry   Nrz   r{   s   & r   Útest_systemAlreadySetÚ3LegacyLogObserverWrapperTests.test_systemAlreadySet„   s/   € ð
 ×%Ñ%¤d°eÀEÔ&JÓKˆØ×Ñ˜˜x�¨%Ö0r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Œ   s   ø€ ÷ 2ñ 2˜tñ 2r   c                ó²   € \        \        4       \        P                  R7      pV P	                  \        V4      4      pV P                  VR,          R4       R# )za
If the new-style C{"log_system"} key is absent, the old-style
C{"system"} key is set to C{"-"}.
)rW   rZ   ry   rY   N)r]   r   r   r\   rS   rE   )r'   rK   r`   s   &  r   Útest_noSystemÚ+LegacyLogObserverWrapperTests.test_noSystemŒ   s=   € ô œd›f´·±Ô>ˆØ—<‘<¤ U£Ó,ˆØ×Ñ˜ (Õ+¨SÖ1r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   –   s   ø€ ÷ 	Lñ 	L Tñ 	Lr   c                óV  € V P                  \        \        P                  ^R7      4       V P                  \        \        P                  ^R7      4       V P                  \        \        P
                  ^ R7      4       V P                  \        \        P                  ^ R7      4       R# )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.
)rZ   ÚisErrorN)rc   r]   r   r\   ÚwarnÚerrorÚcriticalr4   s   &r   Útest_levelNotChangeÚ1LegacyLogObserverWrapperTests.test_levelNotChange–   sj   € ð 	×Ñœd¬X¯]©]ÀAÔFÔGØ×Ñœd¬X¯]©]ÀAÔFÔGØ×Ñœd¬X¯^©^ÀQÔGÔHØ×Ñœd¬X×->Ñ->ÈÔJÖKr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ¡   s   ø€ ÷ 
,ñ 
,¨4ñ 
,r   c                ó|   € V P                  \        \        P                  R7      4      pV P	                  RV4       R# )zù
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.
)rZ   ÚlogLevelN)rc   r]   r   r\   ÚassertNotInr{   s   & r   Útest_pythonLogLevelNotSetÚ7LegacyLogObserverWrapperTests.test_pythonLogLevelNotSet¡   s-   € ð ×%Ñ%¤d´X·]±]Ô&CÓDˆØ×Ñ˜ UÖ+r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ­   s   ø€ ÷ 7ñ 7¨4ñ 7r   c                ón   € V P                  \        RR7      4      pV P                  VR,          R4       R# )zé
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©r�   r�   Nrz   r{   s   & r   Útest_stringPythonLogLevelÚ7LegacyLogObserverWrapperTests.test_stringPythonLogLevel­   s6   € ð ×%Ñ%ÜØ"ôó
ˆð
 	×Ñ˜˜zÕ*¨IÖ6r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   »   s   ø€ ÷ /ñ /˜dñ /r   c                ój   € V P                  \        4       4      pV P                  VR,          R4       R# )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.
ÚmessageNr   rz   r{   s   & r   Útest_messageÚ*LegacyLogObserverWrapperTests.test_message»   s+   € ð
 ×%Ñ%¤d£fÓ-ˆØ×Ñ˜˜yÕ)¨2Ö.r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Ã   s   ø€ ÷ ;ñ ;¨ñ ;r   c                ón   € V P                  \        RR7      4      pV P                  VR,          R4       R# )zF
The old-style C{"message"} key is not modified if it already exists.
)rœ   rœ   Nrg   rz   r{   s   & r   Útest_messageAlreadySetÚ4LegacyLogObserverWrapperTests.test_messageAlreadySetÃ   s.   € ð ×%Ñ%¤d°>Ô&BÓCˆØ×Ñ˜˜yÕ)¨>Ö:r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Ê   s   ø€ ÷ Nñ N˜Tñ Nr   c                óŠ   € V P                  \        RRR7      4      pV P                  \        P                  ! V4      R4       R# )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©rc   r]   rE   r%   ÚtextFromEventDictr{   s   & r   Útest_formatÚ)LegacyLogObserverWrapperTests.test_formatÊ   s6   € ð
 ×%Ñ%¤d°oÈ7Ô&SÓTˆØ×Ñœ×4Ò4°UÓ;¸_ÖMr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Ò   s   ø€ ÷ Nñ N Dñ Nr   c                óŠ   € V P                  \        RRR7      4      pV P                  \        P                  ! V4      R4       R# )zW
Using the message key, which is special in old-style, works for
new-style formatting.
zHello, {message}!r¥   )r¦   rœ   r¨   Nr©   r{   s   & r   Útest_formatMessageÚ0LegacyLogObserverWrapperTests.test_formatMessageÒ   s<   € ð
 ×%Ñ%ÜÐ/¸ÔAó
ˆð 	×Ñœ×4Ò4°UÓ;¸_ÖMr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Ü   s   ø€ ÷ Gñ G tñ Gr   c                óŠ   € V P                  \        RRR7      4      pV P                  \        P                  ! V4      R4       R# )zL
Formatting is not altered if the old-style C{"format"} key already
exists.
zHello!zHowdy!)r¦   r   Nr©   r{   s   & r   Útest_formatAlreadySetÚ3LegacyLogObserverWrapperTests.test_formatAlreadySetÜ   s6   € ð
 ×%Ñ%¤d°hÀxÔ&PÓQˆØ×Ñœ×4Ò4°UÓ;¸XÖFr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Úvaluesr   )Úobjectr   )r   r   s   "€r   r   r   ä   s   ø€ ÷ 
ñ 
©ð 
±Hñ 
r   c           	     óf   € \        \        R4      4      pV P                  \        RRVRR/VB 4      # )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!Úlog_failurer¦   ú	oopsie...r   )r
   ÚRuntimeErrorrc   r]   )r'   r¶   Úfailures   &, r   ÚeventWithFailureÚ.LegacyLogObserverWrapperTests.eventWithFailureä   s;   € ô œ, yÓ1Ó2ˆØ×$Ñ$ÜÑG˜WÐG°ÐGÀÑGó
ð 	
r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ñ   s   ø€ ÷ 4ñ 4˜dñ 4r   c                óÈ   € V P                  4       pV P                  VR,          VR,          4       V P                  VR,          4       V P                  VR,          R4       R# )ze
Captured failures in the new style set the old-style C{"failure"},
C{"isError"}, and C{"why"} keys.
r¼   r¹   rˆ   Úwhyrº   N)r½   ÚassertIsÚ
assertTruerE   r{   s   & r   Útest_failureÚ*LegacyLogObserverWrapperTests.test_failureñ   sO   € ð
 ×%Ñ%Ó'ˆØ�‰�e˜IÕ&¨¨mÕ(<Ô=Ø�‰˜˜iÕ(Ô)Ø×Ñ˜˜u� {Ö3r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   û   s   ø€ ÷ 1ñ 1¨ñ 1r   c                ó„   € \        \        R4      4      pV P                  VR7      pV P                  VR,          V4       R# )ú^
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¼   rK   s   &  r   Útest_failureAlreadySetÚ4LegacyLogObserverWrapperTests.test_failureAlreadySetû   s9   € ô
 œ, }Ó5Ó6ˆØ×%Ñ%¨gÐ%Ó6ˆØ�‰�e˜IÕ&¨Ö0r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r     s   ø€ ÷ .ñ .¨ñ .r   c                ó\   € V P                  ^ R7      pV P                  VR,          ^ 4       R# )z^
Captured failures in the new style do not step on a pre-existing
old-style C{"isError"} key.
©rˆ   rˆ   N©r½   rE   r{   s   & r   Útest_isErrorAlreadySetÚ4LegacyLogObserverWrapperTests.test_isErrorAlreadySet  s,   € ð
 ×%Ñ%¨aÐ%Ó0ˆØ×Ñ˜˜yÕ)¨1Ö-r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r     s   ø€ ÷ /ñ / Dñ /r   c                ó\   € V P                  RR7      pV P                  VR,          R4       R# )rÈ   Úblah)rÁ   rÁ   NrÎ   r{   s   & r   Útest_whyAlreadySetÚ0LegacyLogObserverWrapperTests.test_whyAlreadySet  s+   € ð
 ×%Ñ%¨&Ð%Ó1ˆØ×Ñ˜˜u� vÖ.r   r   N)r=   r>   r?   r@   Ú__doc__r*   rG   rS   rc   rj   rq   ru   r|   r€   r„   rŒ   r’   r˜   r�   r¡   r«   r¯   r³   r½   rÄ   rÉ   rÏ   rÔ   rA   rB   rC   s   @r   r   r      sú   ø‡ € ñ÷	ð 	÷Xð X÷"ð ÷$ð ÷.2ð 2÷/ð /÷/ð /÷1ð 1÷1ð 1÷2ð 2÷	Lð 	L÷
,ð 
,÷7ð 7÷/ð /÷;ð ;÷Nð N÷Nð N÷Gð G÷
ð 
÷4ð 4÷1ð 1÷.ð .÷/ö /r   r   c                   óü   a € ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )ÚPublishToNewObserverTestsi  z$
Tests for L{publishToNewObserver}.
c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   Ú&PublishToNewObserverTests.__annotate__  s   ø€ ÷ ?ñ ?�tñ ?r   c                óf   € . V n         \        \        V P                   P                  4      V n        R # r!   )rP   r   r   rO   r)   r4   s   &r   ÚsetUpÚPublishToNewObserverTests.setUp  s!   € Ø&(ˆŒÜœ\¨4¯;©;×+=Ñ+=Ó>ˆŽr   c                ó@   <€ V ^8„  d   QhRS[ RS[RS[P                  /# )r   rœ   r¶   r   )r1   r·   r%   r9   )r   r   s   "€r   r   rÚ     s(   ø€ ÷ ñ ¡Cð ±6ð ¹i×>QÑ>Qñ r   c                óÚ   € \         P                  ! \        P                  4      ;'       g    / P	                  4       pVP                  V4       WR&   \        4       VR&   RV9  d   ^ VR&   V# )zæ
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
rœ   r   rˆ   )r   Úgetr%   ÚILogContextÚcopyÚupdater   )r'   rœ   r¶   rK   s   &*, r   ÚlegacyEventÚ%PublishToNewObserverTests.legacyEvent  s_   € ô —’œY×2Ñ2Ó3×9Ð9°r×?Ñ?ÓAˆØ�‰�VÔØ"ˆiÑÜ›ˆˆf‰Ø˜EÔ!Ø ˆE�)ÑØˆr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   /  s   ø€ ÷ .ñ .˜tñ .r   c                ó¶   € \        V P                  V P                  4       \        P                  4       V P                  \        V P                  4      ^4       R# )z&
The observer is called exactly once.
N)r   r)   rä   r%   rª   rE   rR   rP   r4   s   &r   Útest_observedÚ'PublishToNewObserverTests.test_observed/  sA   € ô 	Ø�M‰M˜4×+Ñ+Ó-¬y×/JÑ/Jô	
ð 	×Ñœ˜TŸ[™[Ó)¨1Ö-r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   8  s   ø€ ÷ Mñ M˜4ñ Mr   c                óð   € \        V P                  V P                  4       \        P                  4       V P                  V P                  ^ ,          R,          V P                  ^ ,          R,          4       R# )zK
The old-style C{"time"} key is copied to the new-style C{"log_time"}
key.
rW   r   N©r   r)   rä   r%   rª   rE   rP   r4   s   &r   rq   Ú#PublishToNewObserverTests.test_time8  sR   € ô
 	Ø�M‰M˜4×+Ñ+Ó-¬y×/JÑ/Jô	
ð 	×Ñ˜Ÿ™ Q�¨
Õ3°T·[±[Àµ^ÀFÕ5KÖLr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   B  s   ø€ ÷ <ñ <˜dñ <r   c                óÊ   € R R lpV P                  RR4      pV! V4      p\        V P                  W!4       V P                  \	        V P
                  ^ ,          4      V4       R# )z
A published old-style event should format as text in the same way as
the given C{textFromEventDict} callable would format it.
c                ó0   € V ^8„  d   QhR\         R\        /# rJ   )r   r1   )r   s   "r   r   Ú<PublishToNewObserverTests.test_message.<locals>.__annotate__H  s   € ÷ 	Añ 	A¤Xð 	A´#ñ 	Ar   c                 ób   € R P                  \        RP                  V R,          4      4      4      # )Ú Ú rœ   )ÚjoinÚreversed)rK   s   &r   rª   ÚAPublishToNewObserverTests.test_message.<locals>.textFromEventDictH  s$   € Ø—7‘7œ8 C§H¡H¨U°9Õ-=Ó$>Ó?Ó@Ð@r   zHello,zworld!N)rä   r   r)   rE   r   rP   )r'   rª   rK   Útexts   &   r   r�   Ú&PublishToNewObserverTests.test_messageB  sQ   € õ	Að × Ñ  ¨8Ó4ˆÙ  Ó'ˆä˜TŸ]™]¨EÔEØ×Ñœ T§[¡[°¥^Ó4°dÖ;r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   Q  s   ø€ ÷ Eñ E dñ Er   c                óÜ   € \        V P                  V P                  4       \        P                  4       V P                  V P                  ^ ,          R,          \        P                  4       R# )z<
Published event should have log level of L{LogLevel.info}.
rZ   N)	r   r)   rä   r%   rª   rE   rP   r   r\   r4   s   &r   Útest_defaultLogLevelÚ.PublishToNewObserverTests.test_defaultLogLevelQ  sI   € ô 	Ø�M‰M˜4×+Ñ+Ó-¬y×/JÑ/Jô	
ð 	×Ñ˜Ÿ™ Q�¨Õ4´h·m±mÖDr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   Z  s   ø€ ÷ Iñ I˜dñ Ir   c                óà   € \        V P                  V P                  ^R7      \        P                  4       V P                  V P                  ^ ,          R,          \        P                  4       R# )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Í   rZ   N)	r   r)   rä   r%   rª   rE   rP   r   r‹   r4   s   &r   Útest_isErrorÚ&PublishToNewObserverTests.test_isErrorZ  sP   € ô
 	Ø�M‰M˜4×+Ñ+°AÐ+Ó6¼	×8SÑ8Sô	
ð 	×Ñ˜Ÿ™ Q�¨Õ4´h×6GÑ6GÖHr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   d  s   ø€ ÷ Eñ E Tñ Er   c                óü   € \        V P                  V P                  \        P                  R7      \
        P                  4       V P                  V P                  ^ ,          R,          \        P                  4       R# )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.
r—   rZ   N)r   r)   rä   Ú
py_loggingr–   r%   rª   rE   rP   r   r‰   r4   s   &r   Útest_stdlibLogLevelÚ-PublishToNewObserverTests.test_stdlibLogLeveld  sV   € ô 	Ø�M‰MØ×Ñ¤j×&8Ñ&8ÐÓ9Ü×'Ñ'ô	
ð
 	×Ñ˜Ÿ™ Q�¨Õ4´h·m±mÖDr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   q  s   ø€ ÷ Eñ E¨tñ Er   c                óà   € \        V P                  V P                  RR7      \        P                  4       V P                  V P                  ^ ,          R,          \        P                  4       R# )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.
r–   r—   rZ   N)	r   r)   rä   r%   rª   rE   rP   r   r‰   r4   s   &r   Útest_stdlibLogLevelWithStringÚ7PublishToNewObserverTests.test_stdlibLogLevelWithStringq  sP   € ô 	Ø�M‰MØ×Ñ iÐÓ0Ü×'Ñ'ô	
ð
 	×Ñ˜Ÿ™ Q�¨Õ4´h·m±mÖDr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   ~  s   ø€ ÷ 6ñ 6°ñ 6r   c                ó¶   € \        V P                  V P                  RR7      \        P                  4       V P                  RV P                  ^ ,          4       R# )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!!!!!r—   rZ   N)r   r)   rä   r%   rª   r‘   rP   r4   s   &r   Útest_stdlibLogLevelWithGarbageÚ8PublishToNewObserverTests.test_stdlibLogLevelWithGarbage~  sG   € ô 	Ø�M‰MØ×Ñ jÐÓ1Ü×'Ñ'ô	
ð
 	×Ñ˜ d§k¡k°!¥nÖ5r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   ‹  s   ø€ ÷ Hñ H tñ Hr   c                óÀ   € \        V P                  V P                  4       \        P                  4       V P                  V P                  ^ ,          R,          R4       R# )zs
Published event should have a namespace of C{"log_legacy"} to indicate
that it was forwarded from legacy logging.
Úlog_namespaceÚ
log_legacyNrì   r4   s   &r   Útest_defaultNamespaceÚ/PublishToNewObserverTests.test_defaultNamespace‹  sE   € ô
 	Ø�M‰M˜4×+Ñ+Ó-¬y×/JÑ/Jô	
ð 	×Ñ˜Ÿ™ Q�¨Õ8¸,ÖGr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   rÚ   •  s   ø€ ÷ Qñ Q˜Tñ Qr   c                óð   € \        V P                  V P                  4       \        P                  4       V P                  V P                  ^ ,          R,          V P                  ^ ,          R,          4       R# )zO
The old-style C{"system"} key is copied to the new-style
C{"log_system"} key.
rX   ry   Nrì   r4   s   &r   r|   Ú%PublishToNewObserverTests.test_system•  sR   € ô
 	Ø�M‰M˜4×+Ñ+Ó-¬y×/JÑ/Jô	
ð 	×Ñ˜Ÿ™ Q�¨Õ5°t·{±{À1µ~ÀhÕ7OÖPr   )rP   r)   N)r=   r>   r?   r@   rÖ   rÜ   rä   rè   rq   r�   rü   r   r  r	  r  r  r|   rA   rB   rC   s   @r   rØ   rØ     s�   ø‡ € ñ÷?ð ?÷ð ÷".ð .÷Mð M÷<ð <÷Eð E÷Ið I÷Eð E÷Eð E÷6ð 6÷Hð H÷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Ý *Ý "Ý !ß 0ß DÝ ôy/ H×$5Ñ$5ô y/ôxHQ × 1Ñ 1ö HQr   