+
    üÐjmJ  ã                   óÂ  € R t ^ RIt^ RIt^ RIHt ^ RIHtHtHt ^ RI	H
t
 ^ RIHt  ! R R]P                  4      t ! R R	4      tR
 t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      tR t ! R R]4      t ! R R]4      t ! R R]P2                  ]P4                  4      t ! R R]P2                  ]P4                  4      t ! R R]4      tR# ) z/
Test cases for L{jelly} object serialization.
N)ÚStringTransport)ÚbananaÚjellyÚpb)Úunittest)ÚTestCasec                   ó2   a € ] tR t^t o Rt^tRR ltRtV tR# )ÚTestNodez<
An object to test jellyfying of new style class instances.
Nc                ó¦   € V'       d5   VP                   ^,           V n         VP                  P                  V 4       M^V n         Wn        . V n        R# )é   N)ÚidÚchildrenÚappendÚparent)Úselfr   s   &&Ú@/usr/lib/python3/dist-packages/twisted/spread/test/test_jelly.pyÚ__init__ÚTestNode.__init__   s9   € ßØ—i‘i !•mˆDŒGØ�O‰O×"Ñ" 4Õ(àˆDŒGØŒØˆŽó    )r   r   r   ©N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	classAttrr   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r	   r	      s   ø‡ € ñð €I÷ò r   r	   c                   ó*   a € ] tR t^#t o RtR tRtV tR# )ÚAú
Dummy class.
c                ó   € R# ©z+
Method to be used in serialization tests.
N© ©r   s   &r   ÚamethodÚ	A.amethod(   ó   ‚ r   r%   N)r   r   r   r   r   r'   r   r   r   s   @r   r!   r!   #   ó   ø‡ € ñ÷ð r   r!   c                ó   € R# )z2
A dummy function to test function serialization.
Nr%   r&   s   &r   Úafuncr,   .   r)   r   c                   ó*   a € ] tR t^4t o RtR tRtV tR# )ÚBr"   c                ó   € R# r$   r%   r&   s   &r   ÚbmethodÚ	B.bmethod9   r)   r   r%   N)r   r   r   r   r   r0   r   r   r   s   @r   r.   r.   4   r*   r   r.   c                   ó*   a € ] tR t^?t o RtR tRtV tR# )ÚCr"   c                ó   € R# r$   r%   r&   s   &r   ÚcmethodÚ	C.cmethodD   r)   r   r%   N)r   r   r   r   r   r5   r   r   r   s   @r   r3   r3   ?   r*   r   r3   c                   ó   € ] tR t^JtRtRtR# )ÚDz
Dummy new-style class.
r%   N)r   r   r   r   r   r   r%   r   r   r8   r8   J   s   † õr   r8   c                   ó>   a € ] tR t^Pt o RtRtRR ltR tR tRt	V t
R# )ÚEz#
Dummy new-style class with slots.
Nc                ó   € Wn         W n        R # r   ©ÚxÚy©r   r=   r>   s   &&&r   r   Ú
E.__init__W   ó   € ØŒØŽr   c                ó6   € R V P                   RV P                  /# r<   r<   r&   s   &r   Ú__getstate__ÚE.__getstate__[   s   € Ø�T—V‘V˜S $§&¡&Ð)Ð)r   c                ó>   € VR ,          V n         VR,          V n        R# )r=   r>   Nr<   ©r   Ústates   &&r   Ú__setstate__ÚE.__setstate__^   s   € Ø�s•ˆŒØ�s•ˆŽr   r<   )NN)r   r   r   r   r   Ú	__slots__r   rC   rH   r   r   r   s   @r   r:   r:   P   s%   ø‡ € ñð €Iôò*÷ð r   r:   c                   ó,   a € ] tR t^ct o R tR tRtV tR# )ÚSimpleJellyTestc                ó   € Wn         W n        R # r   r<   r?   s   &&&r   r   ÚSimpleJellyTest.__init__d   rA   r   c                ó4   € V P                   VP                   8H  # r   )Ú__dict__©r   Úothers   &&r   ÚisTheSameAsÚSimpleJellyTest.isTheSameAsh   s   € Ø�}‰} §¡Ñ.Ð.r   r<   N)r   r   r   r   r   rS   r   r   r   s   @r   rL   rL   c   s   ø‡ € ò÷/ð /r   rL   c                óØ   € \         P                   ! V4      p\        P                  ! V4      p\        P                  ! V4      p\         P                  ! V4      pV P                  W4       R# )zh
Verify that the given object round-trips through jelly & banana and comes
out equivalent to the input.
N)r   r   ÚencodeÚdecodeÚunjellyÚassertEqual)ÚtestCaseÚtoSerializeÚjelliedÚencodedÚdecodedÚ	unjellieds   &&    r   ÚjellyRoundTripr`   l   sJ   € ô
 �kŠk˜+Ó&€GÜ�mŠm˜GÓ$€GÜ�mŠm˜GÓ$€GÜ—’˜gÓ&€IØ×Ñ˜Ö0r   c                   óö   a € ] tR t^xt o RtR. R#O. R$O. R%O. R&O.tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R!t$V t%R"# )'Ú
JellyTestsz–
Testcases for L{jelly} module serialization.

@cvar decimalData: serialized version of decimal data, to be used in tests.
@type decimalData: L{list}
s   listc                ó<  € \         P                   ! V4      p\         P                  ! 4       pVP                  4        \         P                  ! W44       VP                  P                  V4       V P                  \         P                  \         P                  W44       R# )zÁ
Helper test method to test security options for a type.

@param inputList: a sample input for the type.
@type inputList: L{list}

@param atom: atom identifier for the type.
@type atom: L{str}
N)r   ÚSecurityOptionsÚallowBasicTypesrX   ÚallowedTypesÚpopÚassertRaisesÚInsecureJelly)r   Ú	inputListÚatomÚcÚtasters   &&&  r   Ú_testSecurityÚJellyTests._testSecurityˆ   sh   € ô �KŠK˜	Ó"ˆÜ×&Ò&Ó(ˆØ×ÑÔ ä�Š�aÔ Ø×Ñ×Ñ Ô%à×Ñœ%×-Ñ-¬u¯}©}¸aÖHr   c                óF  € \        4       p\        4       p\        4       pVP                  Vn        Wn        \        P                  p\        = V P                  \        \        P                  \        P                  ! V4      4       V\        n        R#   T\        n        i ; i)zˆ
If a class change after an instance has been created, L{jelly.unjelly}
shoud raise a C{TypeError} when trying to unjelly the instance.
N)
r!   r.   r3   r5   r0   Úarh   Ú	TypeErrorr   rX   )r   rq   Úbrl   Úsavecmethods   &    r   Útest_methodsNotSelfIdentityÚ&JellyTests.test_methodsNotSelfIdentity›   si   € ô
 ‹CˆÜ‹CˆÜ‹CˆØ—I‘IˆŒ	ØŒÜ—i‘iˆÜˆIð	$Ø×Ñœi¬¯©¼¿ºÀA»ÔGà#ŒAŽIø˜ŒA�Iús   Á9B ÂB c                ó\  € \        4       p^Vn        \        4       pW!n        W!n        \        P                  ! V4      p\        P
                  ! V4      pV P                  V\         4       V P                  VP                  VP                  4       V P                  VP                  ^4       R# )zk
Test that a new style class can be jellied and unjellied with its
objects and attribute values preserved.
N)	r8   r=   Ún2Ún3r   rX   ÚassertIsInstanceÚassertIsrY   )r   Únrx   rl   Úms   &    r   Útest_newStyleÚJellyTests.test_newStyle¬   sx   € ô
 ‹CˆØˆŒÜ‹SˆØŒØŒÜ�KŠK˜‹NˆÜ�MŠM˜!ÓˆØ×Ñ˜a¤Ô#Ø�‰�a—d‘d˜AŸD™DÔ!Ø×Ñ˜Ÿ™˜aÖ r   c                óä   € \        4       p^Vn        \        P                  ! V4      p\        P                  ! V4      pV P	                  V\         4       V P                  VP                  ^4       R# )zj
A class defined with I{slots} can be jellied and unjellied with the
values for its attributes preserved.
N)r:   r=   r   rX   rz   rY   )r   r|   rl   r}   s   &   r   Útest_newStyleWithSlotsÚ!JellyTests.test_newStyleWithSlots¼   sQ   € ô
 ‹CˆØˆŒÜ�KŠK˜‹NˆÜ�MŠM˜!ÓˆØ×Ñ˜a¤Ô#Ø×Ñ˜Ÿ™˜aÖ r   c                óŠ   € \         .p\        P                  ! \        P                  ! V4      4      pV P                  W4       R# )zU
Test that a new style class type can be jellied and unjellied
to the original type.
N)r8   r   rX   rY   ©r   ÚtÚrs   &  r   Útest_typeNewStyleÚJellyTests.test_typeNewStyleÈ   s/   € ô
 ˆCˆÜ�MŠMœ%Ÿ+š+ a›.Ó)ˆØ×Ñ˜Ör   c                óŠ   € \         .p\        P                  ! \        P                  ! V4      4      pV P                  W4       R# )zM
Test that a builtin type can be jellied and unjellied to the original
type.
N)Ústrr   rX   rY   r„   s   &  r   Útest_typeBuiltinÚJellyTests.test_typeBuiltinÑ   s/   € ô
 ˆEˆÜ�MŠMœ%Ÿ+š+ a›.Ó)ˆØ×Ñ˜Ör   c                ó.  € \         P                   P                  4       p\         P                   P                  4       V,
          pW.p\        P                  ! V4      p\        P                  ! V4      pV P	                  W54       V P                  W54       R# )z“
Jellying L{datetime.timedelta} instances and then unjellying the result
should produce objects which represent the values of the original
inputs.
N)ÚdatetimeÚnowr   rX   rY   ÚassertIsNot)r   ÚdtnÚdtdrj   rl   Úoutputs   &     r   Útest_dateTimeÚJellyTests.test_dateTimeÚ   sp   € ô ×Ñ×#Ñ#Ó%ˆÜ×Ñ×#Ñ#Ó%¨Õ+ˆØ�Jˆ	Ü�KŠK˜	Ó"ˆÜ—’˜qÓ!ˆØ×Ñ˜Ô+Ø×Ñ˜Ö+r   c                ó<  € \         P                  ! R^^4      p\         P                  ! ^^^R4      p\         P                   P                  W4      pV\         P                   ! R^^4      ,
          p\	        W4       \	        W4       \	        W4       \	        W4       R# )z½
Jellying L{datetime.time}, L{datetime.timedelta}, L{datetime.datetime},
and L{datetime.date} objects should result in jellied objects which can
be serialized and unserialized with banana.
iä  iX  N)rŽ   ÚdateÚtimeÚcombiner`   )r   Ú
sampleDateÚ
sampleTimeÚsampleDateTimeÚsampleTimeDeltas   &    r   Útest_bananaTimeTypesÚJellyTests.test_bananaTimeTypesè   sy   € ô —]’] 4¨¨BÓ/ˆ
Ü—]’] 1 b¨!¨SÓ1ˆ
Ü!×*Ñ*×2Ñ2°:ÓJˆØ(¬8×+<Ò+<¸TÀ1ÀaÓ+HÕHˆÜ�tÔ(Ü�tÔ(Ü�tÔ,Ü�tÖ-r   c                óN  € \         P                  ! R4      \         P                  ! ^ 4      \         P                  ! R4      \         P                  ! R4      .p\        P                  ! V4      p\        P                  ! V4      pV P	                  W4       V P                  W4       R# )z�
Jellying L{decimal.Decimal} instances and then unjellying the result
should produce objects which represent the values of the original
inputs.
ú9.95é@â ú-78.901N)ÚdecimalÚDecimalr   rX   rY   r�   )r   rj   rl   r“   s   &   r   Útest_decimalÚJellyTests.test_decimal÷   su   € ô �OŠO˜FÓ#Ü�OŠO˜AÓÜ�OŠO˜FÓ#Ü�OŠO˜IÓ&ð	
ˆ	ô �KŠK˜	Ó"ˆÜ—’˜qÓ!ˆØ×Ñ˜Ô+Ø×Ñ˜Ö+r   c                ó  € \         P                  ! R4      \         P                  ! ^ 4      \         P                  ! R4      \         P                  ! R4      .p\        P                  ! V P                  4      pV P                  W!4       R# )aÉ  
Unjellying the s-expressions produced by jelly for L{decimal.Decimal}
instances should result in L{decimal.Decimal} instances with the values
represented by the s-expressions.

This test also verifies that L{decimalData} contains valid jellied
data.  This is important since L{test_decimalMissing} re-uses
L{decimalData} and is expected to be unable to produce
L{decimal.Decimal} instances even though the s-expression correctly
represents a list of them.
r¡   r¢   r£   N)r¤   r¥   r   rX   ÚdecimalDatarY   )r   Úexpectedr“   s   &  r   Útest_decimalUnjellyÚJellyTests.test_decimalUnjelly  s_   € ô �OŠO˜FÓ#Ü�OŠO˜AÓÜ�OŠO˜FÓ#Ü�OŠO˜IÓ&ð	
ˆô —’˜t×/Ñ/Ó0ˆØ×Ñ˜Ö*r   c                óX   € \         P                  ! R4      .pV P                  VR4       R# )z¯
By default, C{decimal} objects should be allowed by
L{jelly.SecurityOptions}. If not allowed, L{jelly.unjelly} should raise
L{jelly.InsecureJelly} when trying to unjelly it.
r¡   ó   decimalN)r¤   r¥   rn   ©r   rj   s   & r   Útest_decimalSecurityÚJellyTests.test_decimalSecurity  s%   € ô —_’_ VÓ,Ð-ˆ	Ø×Ñ˜9 jÖ1r   c                ó¨   € 0 Rm.p\         P                  ! \         P                   ! V4      4      pV P                  W4       V P                  W4       R# )z„
Jellying C{set} instances and then unjellying the result
should produce objects which represent the values of the original
inputs.
N¾   r   é   é   )r   rX   rY   r�   ©r   rj   r“   s   &  r   Útest_setÚJellyTests.test_set&  s>   € ò �Kˆ	Ü—’œuŸ{š{¨9Ó5Ó6ˆØ×Ñ˜Ô+Ø×Ñ˜Ö+r   c                óº   € \        . RO4      .p\        P                  ! \        P                  ! V4      4      pV P                  W4       V P	                  W4       R# )zŠ
Jellying L{frozenset} instances and then unjellying the result
should produce objects which represent the values of the original
inputs.
N©r   r´   rµ   )Ú	frozensetr   rX   rY   r�   r¶   s   &  r   Útest_frozensetÚJellyTests.test_frozenset1  sD   € ô šyÓ)Ð*ˆ	Ü—’œuŸ{š{¨9Ó5Ó6ˆØ×Ñ˜Ô+Ø×Ñ˜Ö+r   c                ó4   € 0 Rm.pV P                  VR4       R# )z«
By default, C{set} objects should be allowed by
L{jelly.SecurityOptions}. If not allowed, L{jelly.unjelly} should raise
L{jelly.InsecureJelly} when trying to unjelly it.
s   setNr³   )rn   r¯   s   & r   Útest_setSecurityÚJellyTests.test_setSecurity<  s   € ò �Kˆ	Ø×Ñ˜9 fÖ-r   c                óF   € \        . RO4      .pV P                  VR4       R# )z±
By default, L{frozenset} objects should be allowed by
L{jelly.SecurityOptions}. If not allowed, L{jelly.unjelly} should raise
L{jelly.InsecureJelly} when trying to unjelly it.
s	   frozensetNrº   )r»   rn   r¯   s   & r   Útest_frozensetSecurityÚ!JellyTests.test_frozensetSecurityE  s!   € ô šyÓ)Ð*ˆ	Ø×Ñ˜9 lÖ3r   c                ó  € V P                  \        RR4      P                  \        RR4      4      4       \        ^^4      p\        P                  ! V4      p\        P                  ! V4      pV P                  VP                  V4      4       R# )z
Simplest test case.
rq   rs   N)Ú
assertTruerL   rS   r   rX   )r   rq   Úcerealrs   s   &   r   Útest_simpleÚJellyTests.test_simpleN  sj   € ð 	�‰Ü˜C Ó%×1Ñ1´/À#ÀsÓ2KÓLô	
ô ˜A˜qÓ!ˆÜ—’˜Q“ˆÜ�MŠM˜&Ó!ˆØ�‰˜Ÿ™ aÓ(Ö)r   c                óª  € . pTpVP                  V4       VP                  V4       V P                  V^ ,          V^,          4       V P                  V^ ,          ^ ,          V4       \        P                  ! V4      p\        P                  ! V4      pV P                  V^ ,          V^,          4       V P                  V^ ,          ^ ,          V4       R# )z:
Test to make sure that objects retain identity properly.
N)r   r{   r   rX   )r   r=   r>   ÚsÚzs   &    r   Útest_identityÚJellyTests.test_identityZ  s—   € ð ˆØˆØ	�‰�ŒØ	�‰�ŒØ�‰�a˜•d˜A˜a�DÔ!Ø�‰�a˜•d˜1•g˜qÔ!Ü�KŠK˜‹NˆÜ�MŠM˜!ÓˆØ�‰�a˜•d˜A˜a�DÔ!Ø�‰�a˜•d˜1•g˜qÖ!r   c                óÈ   € R p\         P                  ! \         P                   ! V4      4      pV P                  W4       V P                  \        V4      \        V4      4       R# )ÚblahN)r   rX   rY   Útyper?   s   &  r   Útest_strÚJellyTests.test_stri  sC   € ØˆÜ�MŠMœ%Ÿ+š+ a›.Ó)ˆØ×Ñ˜ÔØ×Ñœ˜a›¤$ q£'Ö*r   c                ó,  € . pR V/V3pVP                  V4       \        P                  ! V4      p\        P                  ! V4      pV P                  V^ ,          R ,          V^,          4       V P                  V^ ,          R ,          ^ ,          V4       R# )ÚlistN©r   r   rX   r{   )r   ÚrerefÚtoplevelTuplerÊ   rË   s   &    r   Útest_stressReferencesÚ JellyTests.test_stressReferenceso  sq   € ØˆØ  %˜¨%Ð0ˆØ�‰�]Ô#Ü�KŠK˜Ó&ˆÜ�MŠM˜!ÓˆØ�‰�a˜•d˜6•l A a¥DÔ)Ø�‰�a˜•d˜6•l 1•o qÖ)r   c                óÚ   € . pV3pVP                  V34       \        P                  ! V4      p\        P                  ! V4      pV P                  V^ ,          ^ ,          ^ ,          V4       R# ©é    NrÕ   )r   rq   r…   rÊ   rË   s   &    r   Útest_moreReferencesÚJellyTests.test_moreReferencesx  sP   € ØˆØˆDˆØ	�‰�!�ŒÜ�KŠK˜‹NˆÜ�MŠM˜!ÓˆØ�‰�a˜•d˜1•g˜a•j !Ö$r   c                óº   € \         P                  ! 4       p\         P                   ! / 4      pV P                  \         P                  \         P                  W!4       R# )z0
Test for type-level security of serialization.
N)r   rd   rh   ri   rX   )r   rm   Údcts   &  r   Útest_typeSecurityÚJellyTests.test_typeSecurity€  s;   € ô ×&Ò&Ó(ˆÜ�kŠk˜"‹oˆØ×Ñœ%×-Ñ-¬u¯}©}¸cÖJr   c                óf   € \         P                  ! \        4      pV P                  \        V4       R # r   )r   rX   r8   r{   )r   Úujs   & r   Útest_newStyleClassesÚJellyTests.test_newStyleClassesˆ  s   € Ü�]Š]œ1ÓˆØ�‰”a˜Ör   c                óâ  € \        4       p\        P                  ! \        P                  ! V4      4       \        P                  ! \        P                  ! VP                  4      4       \        . RO\        ^4      '       * \        ^4      RRRR\         \        R^/\         P                  .pV F=  pV P                  V\        P                  ! \        P                  ! V4      4      4       K?  	  R# )z1
Test for all types currently supported in jelly
ÚtestgÍÌÌÌÌL4@Nrq   rº   )r!   r   rX   r'   r,   Úboolr   rY   )r   rq   ÚitemsÚis   &   r   Útest_lotsaTypesÚJellyTests.test_lotsaTypesŒ  s¢   € ô ‹CˆÜ�Š”e—k’k !“nÔ%Ü�Š”e—k’k !§)¡)Ó,Ô-äÚÜ�Q“ŒKÜ�‹GØØØØÜÜØ�!ˆHÜ�I‰Ið
ˆó ˆAØ×Ñ˜Q¤§¢¬e¯kªk¸!«nÓ =Ö>ó r   c                ór  €  ! R  R4      s \        4       p\        V4      p\        V4      p\        W#34      pW"W3WDRV/p\        P                  ! \        P                  ! V4      4      R,          pV P	                  VP
                  ^ ,          P
                  VP
                  ^,          P
                  4       R# )c                   ó8   a € ] tR tRt o R tR tR tR tRtV t	R# )Ú
TupleStatei§  c                ó   € Wn         R # r   ©rR   rQ   s   &&r   r   ÚTupleState.__init__¨  s   € Ø"–
r   c                ó   € V P                   3# r   rò   r&   s   &r   rC   ÚTupleState.__getstate__«  s   € ØŸ
™
�}Ð$r   c                ó"   € V^ ,          V n         R# rÛ   rò   rF   s   &&r   rH   ÚTupleState.__setstate__®  s   € Ø" 1�X�–
r   c                ó,   € \        V P                  4      # r   )ÚhashrR   r&   s   &r   Ú__hash__ÚTupleState.__hash__±  s   € Ü˜DŸJ™JÓ'Ð'r   rò   N)
r   r   r   r   r   rC   rH   rú   r   r   r   s   @r   rð   rð   §  s   ø‡ € ò#ò%ò&÷(ð (r   rð   Út3N)rð   r!   r   rX   r{   rR   )r   rq   Út1Út2rü   ÚdÚt3primes   &      r   Útest_setStateÚJellyTests.test_setState¤  sŠ   € ÷	(ñ 	(ô ‹CˆÜ˜‹]ˆÜ˜‹]ˆÜ˜˜Ó!ˆØ�R˜R T¨2Ð.ˆÜ—-’-¤§¢¨A£Ó/°Õ5ˆØ�‰�g—m‘m AÕ&×,Ñ,¨g¯m©m¸AÕ.>×.DÑ.DÖEr   c                óò  € \         P                  ! 4       pVP                  \        \        4       \        4       p\	        4       p\        4       pW2n        WBn        W2n        WCn        \         P                   ! W!4      p\         P                  ! WQ4      pV P                  VP                  \         P                  4       \         P                   ! V4      pV P                  \         P                  \         P                  Wq4       V P                  VP                  VP                  R4       \         P                   ! \        V4      p\         P                  ! WQ4      pV P                  V\        RV,          4       R# )z1
Test for class-level security of serialization.
zIdentity mismatchzA came back: %sN)r   rd   ÚallowInstancesOfr!   r.   r3   rs   rl   r=   rX   rz   ÚUnpersistablerh   ri   r{   )r   rm   rq   rs   rl   Úfriendlyr=   Úmeans   &       r   Útest_classSecurityÚJellyTests.test_classSecurity¼  s÷   € ô ×&Ò&Ó(ˆØ×Ñ¤¤1Ô%Ü‹CˆÜ‹CˆÜ‹CˆàŒØŒàŒØŒä—;’;˜qÓ)ˆÜ�MŠM˜(Ó+ˆØ×Ñ˜aŸc™c¤5×#6Ñ#6Ô7ä�{Š{˜1‹~ˆØ×Ñœ%×-Ñ-¬u¯}©}¸dÔKØ�‰�a—c‘c˜1Ÿ3™3Ð 3Ô4ä—;’;œq &Ó)ˆÜ�MŠM˜(Ó+ˆØ�‰�aœÐ-°Õ1Ö2r   c                ój  €  ! R R\         P                  4      p\         P                  ! V\         P                  4       V! 4       pRVn        \         P
                  ! \         P                   ! V4      4      pV P                  VP                  R4       V P                  V\         P                  4       R# )zZ
Test that if Unjellyable is used to deserialize a jellied object,
state comes out right.
c                   ó   € ] tR tRtRtR# )Ú7JellyTests.test_unjellyable.<locals>.JellyableTestClassiÞ  r%   N©r   r   r   r   r   r%   r   r   ÚJellyableTestClassr  Þ  ó   † Ûr   r  ÚvalueN)r   Ú	JellyableÚsetUnjellyableForClassÚUnjellyableÚ	attributerX   rY   rz   )r   r  Úinputr“   s   &   r   Útest_unjellyableÚJellyTests.test_unjellyableØ  s}   € ô	¤§¡ô 	ô 	×$Ò$Ð%7¼×9JÑ9JÔKÙ"Ó$ˆØ!ˆŒÜ—’œuŸ{š{¨5Ó1Ó2ˆØ×Ñ˜×)Ñ)¨7Ô3Ø×Ñ˜f¤e×&7Ñ&7Ö8r   c                óÎ  € / ^.pV3R lpV3R lp\        ^^4      p\        ^^4      p\        ^^4      pWTn        Wdn        WVn        \        P                  ! WBR7      p\        P                  ! WsR7      pV P                  VP                  VP                  P                  4       V P                  V^ ,          R4       V P                  VP                  VP                  R4       R# )r   c                 óp   € V^,          ^,           V^&   W^ ,          V^,          &   \        V^,          4      # )r   )rŠ   )ÚobjÚjelÚpersts   &&&r   ÚpersistentStoreÚ:JellyTests.test_persistentStorage.<locals>.persistentStoreë  s1   € Ø˜Q•x !•|ˆE�!‰HØ!$�!�H�U˜1•XÑÜ�u˜Q•x“=Ð r   c                 ó8   € \        V 4      pV^ ,          V,          # )rÜ   )Úint)ÚpidstrÚunjr  Úpids   &&& r   ÚpersistentLoadÚ9JellyTests.test_persistentStorage.<locals>.persistentLoadð  s   € Ü�f“+ˆCØ˜•8˜C•=Ð r   )r  )r$  zpersistentStore was not called.z$Persistent storage identity failure.N)rL   rs   rl   r   rX   r{   rÅ   )	r   r  r  r$  rq   rs   rl   r  r=   s	   &        r   Útest_persistentStorageÚ!JellyTests.test_persistentStorageè  s´   € Ø�Q�ˆà,1ô 	!ð
 /4ô 	!ô ˜A˜qÓ!ˆÜ˜A˜qÓ!ˆÜ˜A˜qÓ!ˆàŒØŒØŒä�kŠk˜!Ô=ˆÜ�MŠM˜#Ô=ˆà�‰�a—c‘c˜1Ÿ3™3Ÿ5™5Ô!Ø�‰˜˜a�Ð"CÔDØ�‰�a—c‘c˜1Ÿ3™3Ð FÖGr   c                óÖ   € \        4       p\        V4      p\        V4       \        V4       \        P                  ! V4      p\        P                  ! V4      pV P                  W4       R # r   )r	   r   rX   Ú_check_newstyle)r   r|   Ún1r  r}   s   &    r   Útest_newStyleClassesAttributesÚ)JellyTests.test_newStyleClassesAttributes  sI   € Ü‹JˆÜ�a‹[ˆÜ�ŒÜ�Œä�kŠk˜!‹nˆÜ�MŠM˜#Óˆà×Ñ˜QÖ"r   c                ó¦  € V P                  VP                  VP                  4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  \        VP                  4      \        VP                  4      4       \        VP                  VP                  4       F  w  r4V P                  W44       K  	  R# )é   N)rY   r   r   Úlenr   Úzipr)  )r   rq   rs   r=   r>   s   &&&  r   r)  ÚJellyTests._check_newstyle  s‹   € Ø×Ñ˜Ÿ™˜qŸt™tÔ$Ø×Ñ˜Ÿ™ aÔ(Ø×Ñ˜Ÿ™ aÔ(Ø×Ñœ˜QŸZ™Z›¬#¨a¯j©j«/Ô:Ü˜Ÿ
™
 A§J¡JÖ/‰DˆAØ× Ñ  Ö&ó 0r   c                ó�  € \         P                  ! 4       p\         P                  ! 4       pVP                  \	        4       4       \
        P
                  ! WR7      p\         P                  ! 4       pVP                  \	        4       4       \
        P                  ! W4R7      pV P                  VP                  VP                  4       R# )zè
A L{pb.Referenceable} instance jellies to a structure which unjellies to
a L{pb.RemoteReference}.  The C{RemoteReference} has a I{luid} that
matches up with the local object key in the L{pb.Broker} which sent the
L{Referenceable}.
©ÚinvokerN)
r   ÚReferenceableÚBrokerÚmakeConnectionr   r   rX   ÚassertInÚluidÚlocalObjects)r   ÚrefÚjellyBrokerÚjÚunjellyBrokerrä   s   &     r   Útest_referenceableÚJellyTests.test_referenceable  s~   € ô ×ÒÓ ˆÜ—i’i“kˆØ×"Ñ"¤?Ó#4Ô5Ü�KŠK˜Ô1ˆäŸ	š	›ˆØ×$Ñ$¤_Ó%6Ô7ä�]Š]˜1Ô4ˆØ�‰�b—g‘g˜{×7Ñ7Ö8r   r%   N)r®   iã  éþÿÿÿ)r®   rÜ   rÜ   )r®   r¢   rÜ   )r®   iËËþÿéýÿÿÿ)&r   r   r   r   r   r©   rn   ru   r~   r�   r‡   r‹   r”   rž   r¦   r«   r°   r·   r¼   r¿   rÂ   rÇ   rÌ   rÑ   rØ   rÝ   rá   rå   rì   r  r  r  r&  r+  r)  r?  r   r   r   s   @r   rb   rb   x   sÁ   ø‡ € ñð 	ÚÚÚÚ ð€KòIò&$ò"!ò 
!òòò,ò.ò,ò"+ò*2ò	,ò	,ò.ò4ò
*ò"ò+ò*ò%òKòò?ò0Fò03ò89ò Hò6	#ò'÷9ð 9r   rb   c                   ó0   a € ] tR tRt o RtR tR tRtV tR# )ÚJellyDeprecationTestsi)  z#
Tests for deprecated Jelly things
c                ó  € \         P                   V P                  V P                  .4      pV P	                  \        V4      ^4       V P	                  V^ ,          R,          R4       V P	                  V^ ,          R,          \        4       R# )z4
L{jelly.instance_atom} is deprecated since 15.0.0.
Úmessagezltwisted.spread.jelly.instance_atom was deprecated in Twisted 15.0.0: instance_atom is unused within Twisted.ÚcategoryN)r   Úinstance_atomÚflushWarningsÚtest_deprecatedInstanceAtomrY   r/  ÚDeprecationWarning©r   Úwarningss   & r   rJ  Ú1JellyDeprecationTests.test_deprecatedInstanceAtom.  su   € ô 	×ÒØ×%Ñ% t×'GÑ'GÐ&HÓIˆØ×Ñœ˜X›¨Ô*Ø×ÑØ�Q�K˜	Õ"ð>ô	
ð
 	×Ñ˜ !� ZÕ0Ô2DÖEr   c                ó  € \         P                  ! RRR.R..4       V P                  4       pV P                  \	        V4      ^4       V P                  V^ ,          R,          R4       V P                  V^ ,          R,          \
        4       R# )	z9
Unjellying the instance atom is deprecated with 15.0.0.
ÚinstanceÚclassz twisted.spread.test.test_jelly.AÚ
dictionaryrF  ztUnjelly support for the instance atom is deprecated since Twisted 15.0.0.  Upgrade peer for modern instance support.rG  N)r   rX   rI  rY   r/  rK  rL  s   & r   Ú%test_deprecatedUnjellyingInstanceAtomÚ;JellyDeprecationTests.test_deprecatedUnjellyingInstanceAtom<  s‚   € ô 	�ŠØ˜'Ð#EÐFÈÈÐWô	
ð ×%Ñ%Ó'ˆØ×Ñœ˜X›¨Ô*Ø×ÑØ�Q�K˜	Õ"ðIô	
ð
 	×Ñ˜ !� ZÕ0Ô2DÖEr   r%   N)	r   r   r   r   r   rJ  rS  r   r   r   s   @r   rD  rD  )  s   ø‡ € ñòF÷Fð Fr   rD  c                   ó&   a € ] tR tRt o R tRtV tR# )ÚClassAiM  c                ó&   € \        V 4      V n        R # r   )ÚClassBr;  r&   s   &r   r   ÚClassA.__init__N  s   € Ü˜$“<ˆŽr   ©r;  N©r   r   r   r   r   r   r   r   s   @r   rV  rV  M  s   ø‡ € ÷ ð  r   rV  c                   ó&   a € ] tR tRt o R tRtV tR# )rX  iR  c                ó   € Wn         R # r   rZ  )r   r;  s   &&r   r   ÚClassB.__init__S  s   € ØŽr   rZ  Nr[  r   s   @r   rX  rX  R  s   ø‡ € ÷ð r   rX  c                   ó<   a € ] tR tRt o RtR tR tR tR tRt	V t
R# )	ÚCircularReferenceTestsiW  zF
Tests for circular references handling in the jelly/unjelly process.
c                ó4  € \         P                  ! \        \        4       \         P                  ! \        \        4       \         P                  ! \         P                   ! \        4       4      4      pV P                  VP                  P                  VR 4       R# )ú,Identity not preserved in circular referenceN)r   r  rV  rX  rX   r{   r;  )r   rq   s   & r   Útest_simpleCircleÚ(CircularReferenceTests.test_simpleCircle\  sT   € Ü×$Ò$¤V¬VÔ4Ü×$Ò$¤V¬VÔ4Ü�MŠMœ%Ÿ+š+¤f£hÓ/Ó0ˆØ�‰�a—e‘e—i‘i Ð$RÖSr   c                ón  €  ! R  R4      pV! 4       pRVn         \        4       p\        P                  ! \        \        4       \        P                  ! \        \        4       \        P                  ! W2R7      p\        P
                  ! V4      pV P                  VP                  P                  VR4       R# )c                   ó   € ] tR tRtRtR# )ÚHCircularReferenceTests.test_circleWithInvoker.<locals>.DummyInvokerClassic  r%   Nr  r%   r   r   ÚDummyInvokerClassrg  c  r  r   rh  Nr3  rb  )ÚserializingPerspectiverV  r   r  rX  rX   ÚfailUnlessIdenticalr;  )r   rh  ÚdummyInvokerÚa0r=  Úa1s   &     r   Útest_circleWithInvokerÚ-CircularReferenceTests.test_circleWithInvokerb  s   € ÷	ñ 	ñ )Ó*ˆØ.2ˆÔ+Ü‹XˆÜ×$Ò$¤V¬VÔ4Ü×$Ò$¤V¬VÔ4Ü�KŠK˜Ô1ˆÜ�]Š]˜1ÓˆØ× Ñ Ø�F‰F�J‰J˜ÐJö	
r   c                ó4  € \        4       p\        VR4      pVP                  V4       \        P                  ! \        P                  ! V4      4      pV P                  VP                  \         4       V P                  \        VP                  4      V.4       R# )zw
Check that a C{set} can contain a circular reference and be serialized
and unserialized without losing the reference.
N)	ÚsetrL   Úaddr   rX   rz   r=   rY   rÔ   )r   rÊ   rq   Úress   &   r   r·   ÚCircularReferenceTests.test_setq  sf   € ô
 ‹EˆÜ˜A˜tÓ$ˆØ	�‰ˆaŒÜ�mŠmœEŸKšK¨›NÓ+ˆØ×Ñ˜cŸe™e¤SÔ)Ø×Ñœ˜cŸe™e› s eÖ,r   c                ó"  € \        RR4      p\        V.4      pW!n        \        P                  ! \        P                  ! V4      4      pV P                  VP                  \        4       V P                  \        VP                  4      V.4       R# )z}
Check that a L{frozenset} can contain a circular reference and be
serialized and unserialized without losing the reference.
N)rL   r»   r=   r   rX   rz   rY   rÔ   )r   rq   rÊ   rs  s   &   r   r¼   Ú%CircularReferenceTests.test_frozenset}  sd   € ô
 ˜D $Ó'ˆÜ�q�c‹NˆØŒÜ�mŠmœEŸKšK¨›NÓ+ˆØ×Ñ˜cŸe™e¤YÔ/Ø×Ñœ˜cŸe™e› s eÖ,r   r%   N)r   r   r   r   r   rc  rn  r·   r¼   r   r   r   s   @r   r`  r`  W  s$   ø‡ € ñòTò
ò
-÷
-ð 
-r   r`  )r   rŽ   r¤   Útwisted.internet.testingr   Útwisted.spreadr   r   r   Útwisted.trialr   Útwisted.trial.unittestr   r  r	   r!   r,   r.   r3   r8   r:   rL   r`   rb   rD  ÚCopyableÚ
RemoteCopyrV  rX  r`  r%   r   r   Ú<module>r}     sÍ   ðñó
 Û å 4ß ,Ñ ,Ý "Ý +ôˆu�‰ô ÷"ñ ò÷ñ ÷ñ ÷ñ ÷ñ ÷&/ñ /ò	1ôn9�ô n9ôb!F˜Hô !FôH ˆR�[‰[˜"Ÿ-™-ô  ô
ˆR�[‰[˜"Ÿ-™-ô ô
0-˜Xö 0-r   