+
    Dfj                         R t ^ RIt^ RIt^ RIHtHt ^ RIHt  ! R R4      t ! R R4      t	R R	 lt
R
 t ! R R]P                  4      t ! R R]P                  4      tR# )z(
Tests for L{twisted.persisted.styles}.
N)_UniversalPicklingErrorunpickleMethod)unittestc                   <   a  ] tR t^t o RtV 3R lR ltR tRtV tR# )Foo
Helper class.
c                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "D/usr/lib/python3/dist-packages/twisted/persisted/test/test_styles.py__annotate__Foo.__annotate__   s     , ,$ ,    c                    R V n         R# )
test-valueNinstance_memberselfs   &r   __init__Foo.__init__   s
    +r   c                    V P                   # )z
Helper method.
r   r   s   &r   method
Foo.method   s     ###r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell__r   s   @r   r   r      s     , ,$ $r   r   c                       ] tR t^tRtRtR# )Barr   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   s   "r   r   r   $   s       r   c                     R# )z!
A sample function for pickling.
Nr   r   r   r   sampleFunctionr*   $   s    r   c                     V # )Nr   )xs   &r   <lambda>r-   *   s    !r   c                   <   a  ] tR t^-t o RtR tV 3R lR ltRtV tR# )UniversalPicklingErrorTestsz1
Tests the L{_UniversalPicklingError} exception.
c                    \         h)z"
Raise L{UniversalPicklingError}.
)r   r   s   &r   raise_UniversalPicklingError8UniversalPicklingErrorTests.raise_UniversalPicklingError2   s
     &%r   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   (UniversalPicklingErrorTests.__annotate__8   s     S SD Sr   c                Z    V P                  \        P                  V P                  4       R# )zF
Handling L{pickle.PicklingError} handles
L{_UniversalPicklingError}.
N)assertRaisespicklePicklingErrorr1   r   s   &r   test_handledByPickleModule6UniversalPicklingErrorTests.test_handledByPickleModule8   s     
 	&..0Q0QRr   r   N)	r   r   r    r!   r"   r1   r9   r#   r$   r%   s   @r   r/   r/   -   s     &S Sr   r/   c                      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
RtV tR# )UnpickleMethodTestsz(
Tests for the unpickleMethod function.
c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r    UnpickleMethodTests.__annotate__E   s     ( ($ (r   c                    \        4       p\        RV\         4      pV P                  W!P                  4       V P	                  W!P                  4       R# )zR
L{unpickleMethod} returns an instance method bound to the
instance passed to it.
r   N)r   r   assertEqualr   assertIsNotr   fooms   &  r    test_instanceBuildingNamePresent4UnpickleMethodTests.test_instanceBuildingNamePresentE   s=    
 e8S#.JJ'JJ'r   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   r>   O   s     + + +r   c                0   \        4       p\        P                  ! VP                  4      pV P                  W!P                  4       V P	                  W!P                  4       V P                  RV! 4       4       RVn        V P                  RV! 4       4       R# )zI
Copying an instance method returns a new method with the same
behavior.
r   z	new-valueN)r   copyr   r@   rA   r   rB   s   &  r   test_instanceCopyMethod+UnpickleMethodTests.test_instanceCopyMethodO   sm    
 eIIcjj!JJ'JJ'qs+)ac*r   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   r>   \   s     	( 	(T 	(r   c                    \        4       p\        RV\        4      pV P                  W!P                  4       V P                  W!P                  4       R# )z
If the named method is not present in the class,
L{unpickleMethod} finds a method on the class of the instance
and returns a bound method from there.
r   N)r   r   r'   r@   r   rA   rB   s   &  r   #test_instanceBuildingNameNotPresent7UnpickleMethodTests.test_instanceBuildingNameNotPresent\   s=     e8S#.JJ'JJ'r   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   r>   g   s     , ,4 ,r   c                f    \         P                   ! \        4      pV P                  V\        4       R# )zQ
Copying a function returns the same reference, without creating
an actual copy.
N)rI   r*   r@   )r   fs   & r   test_copyFunction%UnpickleMethodTests.test_copyFunctiong   s"    
 IIn%N+r   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   r>   o   s     R RT Rr   c                p    R pV P                  \        P                  ! \        ^ R7      V! R4      4       R# )zL
We do not contaminate normal function pickling with concerns from
Twisted.
c                     R P                  R\        ,           \        P                  RV ,           R.4      P                  R4      # )
cp.ascii)joinr   r*   encode)ns   &r   expected9UnpickleMethodTests.test_primeDirective.<locals>.expectedu   s6    99x!8!8#'3GfWor   )protocol0N)r@   r7   dumpsr*   )r   r`   s   & r   test_primeDirective'UnpickleMethodTests.test_primeDirectiveo   s(    	
 	nqA8C=Qr   c                   < V ^8  d   QhRR/# r	   r   )r   r   s   "r   r   r>   |   s     M M Mr   c                l    V P                  \        P                  \        P                  \        4       R# )zI
Pickling a C{lambda} function ought to raise a L{pickle.PicklingError}.
N)r6   r7   r8   rd   lambdaExampler   s   &r   test_lambdaRaisesPicklingError2UnpickleMethodTests.test_lambdaRaisesPicklingError|   s      	&..mLr   r   N)r   r   r    r!   r"   rE   rJ   rN   rS   re   rj   r#   r$   r%   s   @r   r<   r<   @   sJ     ( (+ +	( 	(, ,R RM Mr   r<   )r"   rI   r7   twisted.persisted.stylesr   r   twisted.trialr   r   r'   r*   ri   TestCaser/   r<   r   r   r   <module>ro      sb      L "$ $  S("3"3 S&@M(++ @Mr   