+
    Dfj:                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	H
t
Ht ^ RIHt ^ RIHtHtHt ^ RIHt ^ RIHt  ! R R	]4      t ! R
 R]P,                  4      t ! R R]P,                  4      t ! R R]4      t ! R R]]4      t ! R R]4      t ! R R]P8                  4      t ! R R]4      t ! R R4      t ! R R4      t  ! R R4      t! ! R R4      t"R  R! lt#]P                  ! ]!]#4        ! R" R#4      t$ ! R$ R%4      t%R& R' lt& ! R( R)]4      t' ! R* R+]4      t( ! R, R-4      t) ! R. R/4      t*]
]R0]+3,          ,          t, ! R1 R2]4      t- ! R3 R4]4      t.]]]'.t/R# )5    )annotationsN)AnyCallableListTuple)NoReturn)aotcrefutilstyles)unittest)TestCasec                  F    ] tR t^tR R ltR R ltR R ltR R ltR	tR
# )VersionTestsc                   V ^8  d   QhRR/#    returnNone )formats   "=/usr/lib/python3/dist-packages/twisted/test/test_persisted.py__annotate__VersionTests.__annotate__   s     2 2 2    c                	    ! R  R4      s \        P                  ! \        4       4      p ! R R\        P                  4      s \        P
                  ! V4      p\        P                  ! 4        VP                  '       g   Q R4       hR# )c                  "    ] tR t^tR R ltRtR# )NullVersionedc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   NullVersioned.__annotate__   s      $ r   c                	    ^ V n         R# )r   Nokselfs   &r   __init__NullVersioned.__init__   	    r   r!   N__name__
__module____qualname____firstlineno__r%   __static_attributes__r   r   r   r   r      s     r   r   c                  &    ] tR t^t^tR R ltRtR# )r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   "   s      4 r   c                	    ^V n         R#    Nr!   r#   s   &r   upgradeToVersion1NullVersioned.upgradeToVersion1"   r'   r   r!   N)r)   r*   r+   r,   persistenceVersionr3   r-   r   r   r   r   r      s    !" r   zinitial upgrade not run!N)r   pickledumpsr   	Versionedloads	doUpgrader"   )r$   pkclmnvs   &  r   test_nullVersionUpgrade$VersionTests.test_nullVersionUpgrade   s`    	 	 ||MO,	F,, 	 ll4 vvv111vr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   )   s      5  5T  5r   c                	    ! R  R\         P                  4      s\        4       pVP                  '       g   VP                  '       d   Q R4       h\
        P                  ! V4      p^\        n        \
        P                  ! V4      p\         P                  ! 4        VP                  '       g   Q R4       hVP                  '       g   Q R4       h\
        P                  ! V4      p\
        P                  ! V4      p\         P                  ! 4        VP                  ^8X  g   Q R4       hVP                  ^8X  g   Q R4       hR# )c                  L    ] tR t^,t^tR.t^ t^ tR R ltR R lt	R R lt
RtR	# )
MyVersionedgarbagedatac                   V ^8  d   QhRR/# r   r   )r   s   "r   r   MyVersioned.__annotate__3   s     < <$ <r   c                	$    R V n         R V n        R# )xxxc                    R # )zcant persistr   )qs   &r   <lambda>&MyVersioned.__init__.<locals>.<lambda>5   s    ^r   N)somedatarC   r#   s   &r   r%   MyVersioned.__init__3   s     %#; r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rE   7         4 r   c                	8    V ;P                   ^,          un         R# r1   )v3r#   s   &r   upgradeToVersion3MyVersioned.upgradeToVersion37       1r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rE   :   rO   r   c                	8    V ;P                   ^,          un         R# r1   )v4r#   s   &r   upgradeToVersion4MyVersioned.upgradeToVersion4:   rT   r   )rC   rL   N)r)   r*   r+   r,   r5   persistenceForgetsrQ   rW   r%   rR   rX   r-   r   r   r   rB   rB   ,   s.    !""/BB< r   rB   zhasn't been upgraded yetzdidn't do version 3 upgradezdidn't do version 4 upgradezupgraded unnecessarilyN)
r   r8   rB   rQ   rW   r6   r7   r5   r9   r:   )r$   mvpicklobjs   &   r   test_versionUpgrade VersionTests.test_versionUpgrade)   s    	&** 	" ]EEERUUU?%??#R )*&ll5!vvv444vvvv444vS!ll5!vv{444{vv{444{r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   K   s     % %d %r   c                	    ! R  R\         P                  4      s\        R^ 4      p\        R^ 4      p\        P                  ! W34      p??^\        n        R \        n        \        P                  ! V4      w  r\         P                  ! 4        V P                  VP                  R4       V P                  VP                  R4       V P                  VP                  4       V P                  VP                  4       R# )c                  .    ] tR t^NtR R ltR R ltRtR# )ClassWithCustomHashc               $    V ^8  d   QhRRRRRR/# )r   uniquestrhashintr   r   r   )r   s   "r   r    ClassWithCustomHash.__annotate__O   s!     ! !s !# !$ !r   c                	    Wn         W n        R # N)re   rg   )r$   re   rg   s   &&&r   r%   ClassWithCustomHash.__init__O   s    $ 	r   c                   V ^8  d   QhRR/# r   r   rh   r   )r   s   "r   r   ri   S   s     ! !# !r   c                	    V P                   # rk   )rg   r#   s   &r   __hash__ClassWithCustomHash.__hash__S   s    yy r   )rg   re   N)r)   r*   r+   r,   r%   rp   r-   r   r   r   rc   rc   N   s    !! !r   rc   v1v2c                    \        V R R4      # )upgradedTsetattrr#   s   &r   rJ   3VersionTests.test_nonIdentityHash.<locals>.<lambda>\   s    W*d>
r   N)r   r8   rc   r6   r7   r5   r3   r9   r:   assertEqualre   
assertTrueru   )r$   rr   rs   pkls   &   r   test_nonIdentityHash!VersionTests.test_nonIdentityHashK   s    	!&"2"2 	! !q) q)llB8$12.1
- c"D)D)$$r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   f   s     & & &r   c                	  a  ! R  R\         P                  4      s ! R R\         P                  4      s\        4       p\        4       p\        P
                  ! V4      \        P
                  ! V4      upo??^\        n        R V3R llpV\        n        ^\        n        R R lpV\        n        \        P                  ! V4      p\         P                  ! 4        V P                  VP                  P                  4       R# )	c                      ] tR t^itRtR# )	ToyClassAr   Nr)   r*   r+   r,   r-   r   r   r   r   r   i       r   r   c                      ] tR t^ltRtR# )	ToyClassBr   Nr   r   r   r   r   r   l   r   r   r   c                    V ^8  d   QhRRRR/# )r   r$   r   r   r   r   )r   s   "r   r   RVersionTests.test_upgradeDeserializesObjectsRequiringUpgrade.<locals>.__annotate__u   s     	 	C 	D 	r   c                h   < \         P                  ! S4      V n        \        P                  ! 4        R # rk   )r6   r9   yr   r:   )r$   pklBs   &r   r3   WVersionTests.test_upgradeDeserializesObjectsRequiringUpgrade.<locals>.upgradeToVersion1u   s    \\$'DFr   c                    V ^8  d   QhRRRR/# )r   r$   objectr   r   r   )r   s   "r   r   r   |   s     	, 	,f 	, 	,r   c                     \        V R R4       R# )ru   TNrv   r#   s   &r   setUpgradedQVersionTests.test_upgradeDeserializesObjectsRequiringUpgrade.<locals>.setUpgraded|   s    D*d+r   N)r   r8   r   r   r6   r7   r5   r3   r9   r:   rz   r   ru   )r$   xr   pklAr3   r   r   s   &     @r   /test_upgradeDeserializesObjectsRequiringUpgrade<VersionTests.test_upgradeDeserializesObjectsRequiringUpgradef   s    	(( 		(( 	 KK\\!_fll1o
dq'(	$	 	 '8	#'(	$	, '2	#LL%r   )r   N)	r)   r*   r+   r,   r=   r^   r|   r   r-   r   r   r   r   r      s    2& 5D%6& &r   r   c                      ] tR t^tRtR# )VersionedSubClassr   Nr   r   r   r   r   r          r   r   c                      ] tR t^tRtR# )SecondVersionedSubClassr   Nr   r   r   r   r   r      r   r   r   c                      ] tR t^tRtR# )VersionedSubSubClassr   Nr   r   r   r   r   r      r   r   r   c                      ] tR t^tRtR# )VersionedDiamondSubClassr   Nr   r   r   r   r   r      r   r   r   c                  J    ] tR t^tRtR R ltR R ltR R ltR R	 ltR
t	R# )AybabtuTestsz
L{styles._aybabtu} gets all of classes in the inheritance hierarchy of its
argument that are strictly between L{Versioned} and the class itself.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   AybabtuTests.__annotate__   s     @ @ @r   c                n    V P                  \        P                  ! \        P                  4      . 4       R# )z=
L{styles._aybabtu} of L{Versioned} itself is an empty list.
N)ry   r   _aybabtur8   r#   s   &r   test_aybabtuStrictEmpty$AybabtuTests.test_aybabtuStrictEmpty   s#     	)9)9:B?r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     A AD Ar   c                Z    V P                  \        P                  ! \        4      . 4       R# )zu
There are no classes I{between} L{VersionedSubClass} and L{Versioned},
so L{styles._aybabtu} returns an empty list.
N)ry   r   r   r   r#   s   &r   test_aybabtuStrictSubclass'AybabtuTests.test_aybabtuStrictSubclass   s    
 	):;R@r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     U U Ur   c                d    V P                  \        P                  ! \        4      \        .4       R# )zn
With a sub-sub-class of L{Versioned}, L{styles._aybabtu} returns a list
containing the intervening subclass.
N)ry   r   r   r   r   r#   s   &r   test_aybabtuSubsubclass$AybabtuTests.test_aybabtuSubsubclass   s"    
 	)=>AR@STr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     
 
D 
r   c                x    V P                  \        P                  ! \        4      \        \
        \        .4       R# )zw
For a diamond-shaped inheritance graph, L{styles._aybabtu} returns a
list containing I{both} intermediate subclasses.
N)ry   r   r   r   r   r   r   r#   s   &r   test_aybabtuStrictAybabtuTests.test_aybabtuStrict   s+    
 	OO45!#46MN	
r   r   N)
r)   r*   r+   r,   __doc__r   r   r   r   r-   r   r   r   r   r      s#    
@AU
 
r   r   c                  "    ] tR t^tR R ltRtR# )MyEphemeralc                    V ^8  d   QhRRRR/# r   r   rh   r   r   r   )r   s   "r   r   MyEphemeral.__annotate__         # $ r   c                	    Wn         R # rk   r   r$   r   s   &&r   r%   MyEphemeral.__init__       r   r   Nr(   r   r   r   r   r      s     r   r   c                  "    ] tR t^tR R ltRtR# )EphemeralTestsc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   EphemeralTests.__annotate__   s     	* 	* 	*r   c                	v   \        ^4      pV P                  VP                  \         4       V P                  VP                  ^4       \        P
                  ! V4      p\        P                  ! V4      pV P                  VP                  \        P                  4       V P                  \        VR4      4       R# )   r   N)r   ry   	__class__r   r6   r7   r9   r   	EphemeralassertFalsehasattr)r$   or\   s   &  r   test_ephemeralEphemeralTests.test_ephemeral   s|    Nk2a QLLf&6&67C)r   r   N)r)   r*   r+   r,   r   r-   r   r   r   r   r      s    	* 	*r   r   c                  .    ] tR t^tR R ltR R ltRtR# )
Pickleablec                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   Pickleable.__annotate__   r   r   c                	    Wn         R # rk   r   r   s   &&r   r%   Pickleable.__init__   r   r   c                   V ^8  d   QhRR/# rn   r   )r   s   "r   r   r      s      c r   c                	    V P                   # rk   r   r#   s   &r   getXPickleable.getX   s    vvr   r   N)r)   r*   r+   r,   r%   r   r-   r   r   r   r   r      s     r   r   c                  &    ] tR t^tRtR R ltRtR# )NotPickleablez!
A class that is not pickleable.
c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   NotPickleable.__annotate__   s     - -H -r   c                    \        R4      h)z)
Raise an exception instead of pickling.
zNot serializable.)	TypeErrorr#   s   &r   
__reduce__NotPickleable.__reduce__   s     +,,r   r   N)r)   r*   r+   r,   r   r   r-   r   r   r   r   r      s    - -r   r   c                  &    ] tR t^tRtR R ltRtR# )CopyRegisteredzV
A class that is pickleable only because it is registered with the
C{copyreg} module.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CopyRegistered.__annotate__   s     - -$ -r   c                $    \        4       V n        R# )z5
Ensure that this object is normally not pickleable.
N)r   notPickleabler#   s   &r   r%   CopyRegistered.__init__   s     +_r   )r   N)r)   r*   r+   r,   r   r%   r-   r   r   r   r   r      s    
- -r   r   c                      ] tR t^tRtRtR# )CopyRegisteredLoadedz*
L{CopyRegistered} after unserialization.
r   N)r)   r*   r+   r,   r   r-   r   r   r   r   r      s    r   r   c                    V ^8  d   QhRRRR/# )r   crr   r   z,tuple[type[CopyRegisteredLoaded], tuple[()]]r   )r   s   "r   r   r      s     	$ 	$V 	$(T 	$r   c                    \         R3# )z
Externally implement C{__reduce__} for L{CopyRegistered}.

@param cr: The L{CopyRegistered} instance.

@return: a 2-tuple of callable and argument list, in this case
    L{CopyRegisteredLoaded} and no arguments.
r   )r   )r   s   &r   reduceCopyRegisteredr      s      ##r   c                  2    ] tR tRt$ RtR]R&   R R ltRtR# )	Ai  
dummy class
zCallable[[], None]bmethodc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   A.__annotate__
         r   c                	    R # rk   r   r#   s   &r   amethod	A.amethod
      r   r   N)r)   r*   r+   r,   r   __annotations__r   r-   r   r   r   r   r     s       r   r   c                  2    ] tR tRt$ RtR]R&   R R ltRtR# )	Bi  r   r   ac                   V ^8  d   QhRR/# r   r   )r   s   "r   r   B.__annotate__  r   r   c                	    R # rk   r   r#   s   &r   r   	B.bmethod  r   r   r   N)r)   r*   r+   r,   r   r   r   r-   r   r   r   r   r     s     	D r   r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     	 	$ 	r   c                     R # rk   r   r   r   r   funktionr     s    r   c                  2    ] tR tRtRtR R ltR R ltRtR# )	PicklingTestsi  z$Test pickling of extra object types.c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   PicklingTests.__annotate__   s     $ $T $r   c                	    \         P                  ! \        4      p\         P                  ! V4      pV P	                  V\        4       R # rk   )r6   r7   r   r9   ry   )r$   r\   r   s   &  r   test_modulePicklingTests.test_module   s.    V$LLF#r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  %  s     2 2T 2r   c                	   \        ^4      p\        P                  ! VP                  4      p\        P                  ! V4      pV P                  V! 4       ^4       V P                  \        V4      \        VP                  4      4       R# )   N)r   r6   r7   r   r9   ry   type)r$   r]   r\   r   s   &   r   test_instanceMethod!PicklingTests.test_instanceMethod%  sY    mSXX&LLa a$sxx.1r   r   N)r)   r*   r+   r,   r   r  r  r-   r   r   r   r  r    s    .$
2 2r   r  c                  &    ] tR tRtRtR R ltRtR# )StringIOTransitionTestsi-  z
When pickling a cStringIO in Python 2, it should unpickle as a BytesIO or a
StringIO in Python 3, depending on the type of its contents.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   $StringIOTransitionTests.__annotate__3  s     4 4d 4r   c                    Rp\         P                  ! V4      pV P                  V\        P                  4       V P                  VP                  4       R4       R# )zO
A cStringIO pickled with bytes in it will yield an L{io.BytesIO} on
python 3.
sE   ctwisted.persisted.styles
unpickleStringI
p0
(S'test'
p1
I0
tp2
Rp3
.testN)r6   r9   assertIsInstanceioStringIOry   getvalue)r$   pickledStringIWithTextloadeds   &  r   test_unpickleBytesIO,StringIOTransitionTests.test_unpickleBytesIO3  sH    - 	 45fbkk2*F3r   r   N)r)   r*   r+   r,   r   r  r-   r   r   r   r  r  -  s    
4 4r   r  c                  B    ] tR tRt$ R ]R&   R ]R&   R]R&   R R ltRtR	# )
EvilSourceroriA  r   br   cc                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   EvilSourceror.__annotate__F  s      & T r   c                	f    W n         W P                   n        WP                   P                  n        R # rk   )r   r  r  r   s   &&r   r%   EvilSourceror.__init__F  s    
r   )r   N)r)   r*   r+   r,   r   r%   r-   r   r   r   r  r  A  s    I r   r  c                  :    ] tR tRt$ R]R&   R R ltR R ltRtR	# )
NonDictStateiL  rf   statec                   V ^8  d   QhRR/# )r   r   rf   r   )r   s   "r   r   NonDictState.__annotate__O  s      c r   c                	    V P                   # rk   r&  r#   s   &r   __getstate__NonDictState.__getstate__O  s    zzr   c                    V ^8  d   QhRRRR/# )r   r&  rf   r   r   r   )r   s   "r   r   r(  R  s      # $ r   c                	    Wn         R # rk   r*  )r$   r&  s   &&r   __setstate__NonDictState.__setstate__R  s    
r   r*  N)r)   r*   r+   r,   r   r+  r/  r-   r   r   r   r%  r%  L  s    J r   r%  _CircularTupleTypec                      ] tR tRtR R ltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
R R ltR R ltR R ltRtR# )AOTTestsiY  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   AOTTests.__annotate__Z  s     % %$ %r   c           
     	    ^RRR\        ^^^4      RR\        P                  ^,           R\        3
p\        P
                  ! \        P                  ! V4      4      pV P                  W4       R# )r2   g       @y              @ThelloworldN)slicesysmaxsizeEllipsisr	   unjellyFromSourcejellyToSourcery   )r$   r]   rtObjs   &  r   test_simpleTypesAOTTests.test_simpleTypesZ  sb    !QNKK!O
 %%c&7&7&<=$r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5  j  s     T T Tr   c                	`   \        4       p\        4       pVP                  Vn        Wn        \        P
                  ! \        P                  ! V4      4      P                  P                  pV P                  \        P                  ! V4      P                  \        P                  ! V4      4       R # rk   )r   r   r   r   r	   r=  r>  ry   _selfOfMethodr   _classOfMethod)r$   r   r  im_s   &   r   test_methodSelfIdentity AOTTests.test_methodSelfIdentityj  ss    CCII	##C$5$5a$89;;CC**3/993;M;Mc;RSr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5  r  s     % %D %r   c                2   \        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{aot.unjellyFromSource} shoud raise a C{TypeError} when trying to
unjelly the instance.
N)	r   r   r   r   assertRaisesr   r	   r=  r>  )r$   r   r  savedbmethods   &   r   test_methodNotSelfIdentity#AOTTests.test_methodNotSelfIdentityr  sh     CCII	yyI	%i)>)>@Q@QRS@TU$AIAIs   9B	 	Bc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     G Gd Gr   c                n     ! R R4      pV P                  \        \        P                  V! 4       4       R# )z
L{aot.jellyToSource} should raise a C{TypeError} when trying to jelly
an unknown type without a C{__dict__} property or C{__getstate__}
method.
c                  B    ] tR tRt]R R l4       t]R R l4       tRtR# )2AOTTests.test_unsupportedType.<locals>.UnknownTypei  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ?AOTTests.test_unsupportedType.<locals>.UnknownType.__annotate__  s     ' '( 'r   c                	    \        4       hrk   AttributeErrorr#   s   &r   __dict__;AOTTests.test_unsupportedType.<locals>.UnknownType.__dict__      $&&r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rT    s     ' 'h 'r   c                	    \        4       hrk   rV  r#   s   &r   r+  ?AOTTests.test_unsupportedType.<locals>.UnknownType.__getstate__  rZ  r   r   N)r)   r*   r+   r,   propertyrX  r+  r-   r   r   r   UnknownTyperR    s(    ' ' ' 'r   r_  N)rK  r   r	   r>  )r$   r_  s   & r   test_unsupportedTypeAOTTests.test_unsupportedType  s(    	' 	' 	)S%6%6Fr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     $ $D $r   c                	   \         P                  ! 4       P                  pR RRV/p^^^RR^R^d^d,          \        \         P                  V\        .p\        V4      pVP                  V4       VP                  V4       VP                  V4       \         P                  ! \         P                  ! W3.4      4      pV^ ,          V^,          J g   Q hV^,          R,          VR,          8X  g   Q hR# )r7  r8  methodzhe	llo

"x world!u   goodbye 
	တ world!g      ?:r      NN)	r	   
AOTJellier	jellyToAOr   r   tupleappendr=  r>  )r$   ajdltujs   &     r   test_basicIdentityAOTTests.test_basicIdentity  s     ^^''gx,"'HNN
 !H			""3#4#4aV#<=!u1~~!uSzQsV###r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     L L4 Lr   c                	    \        4       pR Vn        \        P                  ! \        P                  ! V4      4      P                  VP                  8X  g   Q hR# )z	meringue!N)r%  r&  r	   r=  r>  )r$   r   s   & r   test_nonDictStateAOTTests.test_nonDictState  s>    N$$S%6%6q%9:@@AGGKKKr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     8 8d 8r   c                    \         P                  ! \         P                  ! \        4       4      4      pV P	                  V\
        4       R# )zk
L{aot.jellyToSource} and L{aot.unjellyFromSource} honor functions
registered in the pickle copy registry.
N)r	   r=  r>  r   r  r   )r$   rn  s   & r   test_copyRegAOTTests.test_copyReg  s3    
 ""3#4#4^5E#FGb"67r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     " "d "r   c                	B   \        \        . 4      4      p\        P                  ! V4      p\        P                  ! V4      pVP                  VJ g   Q hVP                  P
                  VP
                  J g   Q hVP                  VP                  P                  Jg   Q hR # rk   )r  r	   
jellyToAOTunjellyFromAOTr   r  r  )r$   r   j1ojs   &   r   test_funkyReferencesAOTTests.test_funkyReferences  sq    -+,^^A#ttrzzttvv~~tt24466!!!r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     ) )D )r   c                F   . pVR3pVP                  V4       \        P                  ! V4      p\        P                  ! V4      pV P	                  V^ ,          \
        4       V P                  V^ ,          ^ ,          V4       V P                  V^ ,          ^,          R4       R# )zC
L{aot.jellyToAOT} can persist circular references through tuples.
i  N)ri  r	   r{  r|  r  rh  assertIsry   )r$   rl  rm  r}  r~  s   &    r   test_circularTupleAOTTests.test_circularTuple  s}     !#I	^^A#beU+beAh#Aq4(r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r5    s     
 
t 
r   c                    V P                  \        P                  ! RR. //4      \        P                  ! R4      4       R# )z*
The generated serialization is indented.
r7  r8  z|                app={
                  'hello':{
                    'world':[],
                    },
                  }N)ry   r	   r>  textwrapdedentr#   s   &r   testIndentifyAOTTests.testIndentify  s:     	w"67OO
	
r   r   N)r)   r*   r+   r,   r@  rG  rM  r`  ro  rs  rw  r  r  r  r-   r   r   r   r3  r3  Y  s<    % T%"G$$6L
8")
 
r   r3  c                  V    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	Rt
R# )CrefUtilTestsi  z
Tests for L{crefutil}.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CrefUtilTests.__annotate__  s     = =T =r   c                v    \         P                  ! / 4      pV P                  \        VP                  ^^4       R# )z?
L{crefutil._DictKeyAndValue} only support keys C{0} and C{1}.
N)r
   _DictKeyAndValuerK  RuntimeError__setitem__r$   rk  s   & r   test_dictUnknownKey!CrefUtilTests.test_dictUnknownKey  s,     %%b),q!<r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     = =D =r   c                ~    \         P                  ! 4       p^V^ &   V P                  \        VP                  ^ ^4       R# )z9
L{crefutil._Defer} can be assigned a key only one time.
N)r
   _DeferrK  r  r  r  s   & r   test_deferSetMultipleTimes(CrefUtilTests.test_deferSetMultipleTimes  s1     OO!,q!<r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     S S Sr   c                    \         P                  ! . RO\        4      pV P                  \        VP
                  / R4       R# )z
A L{crefutil._Container} where all of its elements are known at
construction time is nonsensical and will result in errors in any call
to addDependant.
z	ignore-meN)r2   r   r   )r
   
_ContainerlistrK  AssertionErroraddDependant)r$   	containers   & r   &test_containerWhereAllElementsAreKnown4CrefUtilTests.test_containerWhereAllElementsAreKnown  s0     ''	48	.)*@*@"kRr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     	
 	
 	
r   c                    V P                  \        \        4       P                  \        P
                  ! 4       R4       R# )z
If a dictionary key contains a circular reference (which is probably a
bad practice anyway) it will be resolved by a
L{crefutil._DictKeyAndValue}, not by placing a L{crefutil.NotKnown}
into a dictionary key.
valueN)rK  r  dictr  r
   NotKnownr#   s   &r   .test_dontPutCircularReferencesInDictionaryKeys<CrefUtilTests.test_dontPutCircularReferencesInDictionaryKeys  s,     	DF..0A0A0CW	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     	
 	
D 	
r   c                    V P                  \        \        P                  ! R\        P                  ! 4       \
        4      4       R# )z
L{crefutil._InstanceMethod} raises L{AssertionError} to indicate it
should not be called.  This should not be possible with any of its API
clients, but is provided for helping to debug.
no_nameN)rK  r  r
   _InstanceMethodr  r  r#   s   &r   *test_dontCallInstanceMethodsThatArentReady8CrefUtilTests.test_dontCallInstanceMethodsThatArentReady  s0     	$$Y0A0A0CTJ	
r   r   N)r)   r*   r+   r,   r   r  r  r  r  r  r-   r   r   r   r  r    s&    ==S	
	
 	
r   r  )0
__future__r   copyregr  r6   r:  r  typingr   r   r   r   r   twisted.persistedr	   r
   r   twisted.trialr   twisted.trial.unittestr   r   r8   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r%  rh   r1  r3  r  	testCasesr   r   r   <module>r     sr   #  	  
  - -  4 3 " +n&8 n&b	(( 		f.. 		, 		35L 	"
8 "
J&"" 

*X 
* 	- 	-
- 
- 	$ ~3 4  	2H 2 4h 4(   % 4c 9:; H
x H
V1
H 1
h >=9	r   