+
    üÐj”_  ã                   óþ  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt  ! R R4      t ! R R	]4      t ! R
 R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R4      t ! R R]4      t ! R R4      t ! R R]]4      t]! R]3RRRR/4      t ! R  R!]4      t ! R" R#]4      t ! R$ R%]4      t ! R& R']4      t  ! R( R)]4      t! ! R* R+]4      t" ! R, R-]4      t#R# ).z6
Test cases for the L{twisted.python.reflect} module.
N)Údeque)Úreflect)ÚaccumulateMethodsÚaddMethodNamesToDictÚfullyQualifiedNameÚprefixedMethodNamesÚprefixedMethods)ÚSynchronousTestCasec                   ó*   a € ] tR t^t o RtR tRtV tR# )ÚBasezT
A no-op class which can be used to verify the behavior of
method-discovering APIs.
c                ó   € R# )z)
A no-op method which can be discovered.
N© ©Úselfs   &Ú;/usr/lib/python3/dist-packages/twisted/test/test_reflect.pyÚmethodÚBase.method   ó   ‚ ó    r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ñ÷
ð r   r   c                   ó   € ] tR t^$tRtRtR# )ÚSubz>
A subclass of a class with a method which can be discovered.
r   N)r   r   r   r   r   r   r   r   r   r   r   $   s   † õr   r   c                   ó0   a € ] tR t^*t o RtR tR tRtV tR# )ÚSeparatez5
A no-op class with methods with differing prefixes.
c                ó   € R# )z:
A no-op method which a matching prefix to be discovered.
Nr   r   s   &r   Úgood_methodÚSeparate.good_method/   r   r   c                ó   € R# )z?
A no-op method with a mismatched prefix to not be discovered.
Nr   r   s   &r   Ú
bad_methodÚSeparate.bad_method4   r   r   r   N)	r   r   r   r   r   r#   r&   r   r   r   s   @r   r!   r!   *   s   ø‡ € ñò÷
ð r   r!   c                   ó6   a € ] tR t^:t o RtR tR tR tRtV t	R# )ÚAccumulateMethodsTestszh
Tests for L{accumulateMethods} which finds methods on a class hierarchy and
adds them to a dictionary.
c                óp   € \        4       p/ p\        W4       V P                  RVP                  /V4       R# )zÍ
If x is and instance of Base and Base defines a method named method,
L{accumulateMethods} adds an item to the given dictionary with
C{"method"} as the key and a bound method object for Base.method value.
r   N)r   r   ÚassertEqualr   ©r   ÚxÚoutputs   &  r   Útest_ownClassÚ$AccumulateMethodsTests.test_ownClass@   s1   € ô ‹FˆØˆÜ˜!Ô$Ø×Ñ˜( A§H¡HÐ-¨vÖ6r   c                óp   € \        4       p/ p\        W4       V P                  RVP                  /V4       R# )zð
If x is an instance of Sub and Sub is a subclass of Base and Base
defines a method named method, L{accumulateMethods} adds an item to the
given dictionary with C{"method"} as the key and a bound method object
for Base.method as the value.
r   N)r   r   r+   r   r,   s   &  r   Útest_baseClassÚ%AccumulateMethodsTests.test_baseClassK   s1   € ô ‹EˆØˆÜ˜!Ô$Ø×Ñ˜( A§H¡HÐ-¨vÖ6r   c                ór   € \        4       p/ p\        WR4       V P                  RVP                  /V4       R# )z°
If a prefix is given, L{accumulateMethods} limits its results to
methods beginning with that prefix.  Keys in the resulting dictionary
also have the prefix removed from them.
Úgood_r   N)r!   r   r+   r#   r,   s   &  r   Útest_prefixÚ"AccumulateMethodsTests.test_prefixW   s3   € ô ‹JˆØˆÜ˜! WÔ-Ø×Ñ˜( A§M¡MÐ2°FÖ;r   r   N)
r   r   r   r   r   r/   r2   r6   r   r   r   s   @r   r)   r)   :   s   ø‡ € ñò
	7ò
7÷	<ð 	<r   r)   c                   ó0   a € ] tR t^ct o RtR tR tRtV tR# )ÚPrefixedMethodsTestszf
Tests for L{prefixedMethods} which finds methods on a class hierarchy and
adds them to a dictionary.
c                ój   € \        4       p\        V4      pV P                  VP                  .V4       R# )zK
L{prefixedMethods} returns a list of the methods discovered on an
object.
N)r   r   r+   r   r,   s   &  r   Útest_onlyObjectÚ$PrefixedMethodsTests.test_onlyObjecti   s+   € ô
 ‹FˆÜ  Ó#ˆØ×Ñ˜!Ÿ(™(˜ VÖ,r   c                ól   € \        4       p\        VR4      pV P                  VP                  .V4       R# )zW
If a prefix is given, L{prefixedMethods} returns only methods named
with that prefix.
r5   N)r!   r   r+   r#   r,   s   &  r   r6   Ú PrefixedMethodsTests.test_prefixr   s-   € ô
 ‹JˆÜ   GÓ,ˆØ×Ñ˜!Ÿ-™-˜¨&Ö1r   r   N)	r   r   r   r   r   r;   r6   r   r   r   s   @r   r9   r9   c   s   ø‡ € ñò
-÷2ð 2r   r9   c                   ó0   a € ] tR t^|t o RtR tR tRtV tR# )ÚPrefixedMethodNamesTestsz#
Tests for L{prefixedMethodNames}.
c                óH   € V P                  R.\        \        R4      4       R# )zr
L{prefixedMethodNames} returns a list including methods with the given
prefix defined on the class passed to it.
r   r5   N)r+   r   r!   r   s   &r   Útest_methodÚ$PrefixedMethodNamesTests.test_method�   s   € ð
 	×Ñ˜(˜Ô%8¼À7Ó%KÖLr   c                ó^   €  ! R R\         4      pV P                  R.\        VR4      4       R# )z�
L{prefixedMethodNames} returns a list included methods with the given
prefix defined on base classes of the class passed to it.
c                   ó   € ] tR t^ŽtRtR# )Ú<PrefixedMethodNamesTests.test_inheritedMethod.<locals>.Childr   N©r   r   r   r   r   r   r   r   ÚChildrF   Ž   ó   † Ûr   rH   r   r5   N)r!   r+   r   )r   rH   s   & r   Útest_inheritedMethodÚ-PrefixedMethodNamesTests.test_inheritedMethodˆ   s*   € ô	”Hô 	ð 	×Ñ˜(˜Ô%8¸ÀÓ%HÖIr   r   N)	r   r   r   r   r   rB   rJ   r   r   r   s   @r   r@   r@   |   s   ø‡ € ñòM÷	Jð 	Jr   r@   c                   ó*   a € ] tR t^”t o RtR tRtV tR# )ÚAddMethodNamesToDictTestsz$
Tests for L{addMethodNamesToDict}.
c                ó€   €  ! R R4      p ! R R\         V4      p/ p\        W#RV4       V P                  R^/V4       R# )z�
If C{baseClass} is passed to L{addMethodNamesToDict}, only methods which
are a subclass of C{baseClass} are added to the result dictionary.
c                   ó   € ] tR t^ŸtRtR# )Ú;AddMethodNamesToDictTests.test_baseClass.<locals>.Alternater   NrG   r   r   r   Ú	AlternaterP   Ÿ   rI   r   rQ   c                   ó&   a € ] tR t^¢t o R tRtV tR# )Ú7AddMethodNamesToDictTests.test_baseClass.<locals>.Childc                ó   € R # ©Nr   r   s   &r   Úgood_alternateÚFAddMethodNamesToDictTests.test_baseClass.<locals>.Child.good_alternate£   ó   € Ùr   r   N)r   r   r   r   rV   r   r   r   s   @r   rH   rS   ¢   ó   ø‡ € ÷ð r   rH   r5   Ú	alternateN)r!   r   r+   )r   rQ   rH   Úresults   &   r   r2   Ú(AddMethodNamesToDictTests.test_baseClass™   sB   € ÷	ñ 	ô	”H˜iô 	ð ˆÜ˜U¨G°YÔ?Ø×Ñ˜+ qÐ)¨6Ö2r   r   N)r   r   r   r   r   r2   r   r   r   s   @r   rM   rM   ”   s   ø‡ € ñ÷3ð 3r   rM   c                   ó*   a € ] tR t^«t o RtR tRtV tR# )ÚSummerz1
A class we look up as part of the LookupsTests.
c                ó   € R# )z
Do something.
Nr   r   s   &r   Ú	reallySetÚSummer.reallySet°   r   r   r   N)r   r   r   r   r   r`   r   r   r   s   @r   r^   r^   «   s   ø‡ € ñ÷ð r   r^   c                   ór   a € ] tR t^¶t o 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# )ÚLookupsTestsz;
Tests for L{namedClass}, L{namedModule}, and L{namedAny}.
c                óZ   € V P                  \        P                  ! R4      \        4       R# )zI
L{namedClass} should return the class object for the name it is passed.
ú twisted.test.test_reflect.SummerN)ÚassertIsr   Ú
namedClassr^   r   s   &r   Útest_namedClassLookupÚ"LookupsTests.test_namedClassLookup»   s   € ð 	�‰”g×(Ò(Ð)KÓLÌfÖUr   c                ó^   € ^ RI Hp V P                  \        P                  ! R4      V4       R# )zK
L{namedModule} should return the module object for the name it is
passed.
©Úmonkeyútwisted.python.monkeyN)Útwisted.pythonrl   rf   r   ÚnamedModule©r   rl   s   & r   Útest_namedModuleLookupÚ#LookupsTests.test_namedModuleLookupÁ   s!   € õ
 	*à�‰”g×)Ò)Ð*AÓBÀFÖKr   c                ón   € ^ RI pV P                  \        P                  ! R4      VP                  4       R# )zI
L{namedAny} should return the package object for the name it is passed.
Nútwisted.python)rn   rf   r   ÚnamedAnyÚpython©r   Útwisteds   & r   Útest_namedAnyPackageLookupÚ'LookupsTests.test_namedAnyPackageLookupÊ   s%   € ó 	à�‰”g×&Ò&Ð'7Ó8¸'¿.¹.ÖIr   c                ó^   € ^ RI Hp V P                  \        P                  ! R4      V4       R# )zH
L{namedAny} should return the module object for the name it is passed.
rk   rm   N)rn   rl   rf   r   ru   rp   s   & r   Útest_namedAnyModuleLookupÚ&LookupsTests.test_namedAnyModuleLookupÒ   s!   € õ 	*à�‰”g×&Ò&Ð'>Ó?ÀÖHr   c                óZ   € V P                  \        P                  ! R4      \        4       R# )zG
L{namedAny} should return the class object for the name it is passed.
re   N)rf   r   ru   r^   r   s   &r   Útest_namedAnyClassLookupÚ%LookupsTests.test_namedAnyClassLookupÚ   s   € ð 	�‰”g×&Ò&Ð'IÓJÌFÖSr   c                ón   € V P                  \        P                  ! R4      \        P                  4       R# )z~
L{namedAny} should return the object an attribute of a non-module,
non-package object is bound to for the name it is passed.
z*twisted.test.test_reflect.Summer.reallySetN)r+   r   ru   r^   r`   r   s   &r   Útest_namedAnyAttributeLookupÚ)LookupsTests.test_namedAnyAttributeLookupà   s*   € ð 	×ÑÜ×ÒÐIÓJÜ×Ñö	
r   c                ó‚   € V P                  \        P                  ! R4      \        P                  P
                  4       R# )z©
L{namedAny} should return the object an attribute of an object which
itself was an attribute of a non-module, non-package object is bound to
for the name it is passed.
z2twisted.test.test_reflect.Summer.reallySet.__doc__N)rf   r   ru   r^   r`   r   r   s   &r   Ú"test_namedAnySecondAttributeLookupÚ/LookupsTests.test_namedAnySecondAttributeLookupí   s.   € ð 	�‰Ü×ÒÐTÓUÜ×Ñ×$Ñ$ö	
r   c                ó.  € V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \
        \        P                  R4       R# )zu
Exceptions raised by modules which L{namedAny} causes to be imported
should pass through L{namedAny} to the caller.
ztwisted.test.reflect_helper_ZDEztwisted.test.reflect_helper_VEztwisted.test.reflect_helper_IEN)ÚassertRaisesÚZeroDivisionErrorr   ru   Ú
ValueErrorÚImportErrorr   s   &r   Útest_importExceptionsÚ"LookupsTests.test_importExceptionsø   sz   € ð
 	×ÑÜœw×/Ñ/Ð1Rô	
ð 	×ÑÜœw×/Ñ/Ð1Rô	
ð 	×ÑÜœ×(Ñ(Ð*Jô	
ð
 	×ÑÜœ×)Ñ)Ð+Kö	
r   c                óä   € V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       R# )zÏ
If segments on the end of a fully-qualified Python name represents
attributes which aren't actually present on the object represented by
the earlier segments, L{namedAny} should raise an L{AttributeError}.
ztwisted.nosuchmoduleintheworldz twisted.nosuch.modulein.theworldz0twisted.test.test_reflect.Summer.nosuchattributeN)rˆ   ÚAttributeErrorr   ru   r   s   &r   Útest_attributeExceptionsÚ%LookupsTests.test_attributeExceptions  s]   € ð 	×ÑÜœG×,Ñ,Ð.Nô	
ð 	×ÑÜœG×,Ñ,Ð.Pô	
ð 	×ÑÜÜ×ÑØ>ö	
r   c                ó  € V P                  \        P                  \        P                  R4      pV P	                  \        V4      R4       V P                  \        P                  \        P                  R4      pV P	                  \        V4      R4       V P                  \        P                  \        P                  R4      pV P	                  \        V4      R4       V P                  \        P                  \        P                  R4      pV P	                  \        V4      R4       R FQ  pV P                  \        P                  \        P                  V4      pV P	                  \        V4      R	V: 24       KS  	  R
# )aU  
Passing a name which isn't a fully-qualified Python name to L{namedAny}
should result in one of the following exceptions:
 - L{InvalidName}: the name is not a dot-separated list of Python
   objects
 - L{ObjectNotFound}: the object doesn't exist
 - L{ModuleNotFound}: the object doesn't exist and there is only one
   component in the name
Únosuchmoduleintheworldz(No module named 'nosuchmoduleintheworld'z@#$@(#.!@(#!@#z('@#$@(#.!@(#!@#' does not name an objectztcelfer.nohtyp.detsiwtz0'tcelfer.nohtyp.detsiwt' does not name an objectÚ zEmpty module namezMname must be a string giving a '.'-separated list of Python identifiers, not N)z.twistedztwisted.ztwisted..python)rˆ   r   ÚModuleNotFoundru   r+   ÚstrÚObjectNotFoundÚInvalidName)r   ÚerrÚinvalidNames   &  r   Útest_invalidNamesÚLookupsTests.test_invalidNames"  s4  € ð ×ÑÜ×"Ñ"¤G×$4Ñ$4Ð6Nó
ˆð 	×Ñœ˜S›Ð#MÔNð ×ÑÜ×"Ñ"¤G×$4Ñ$4Ð6Fó
ˆð 	×Ñœ˜S›Ð#MÔNà×ÑÜ×"Ñ"¤G×$4Ñ$4Ð6Nó
ˆð 	×Ñœ˜S›Ð#UÔVà×Ñ¤× 3Ñ 3´W×5EÑ5EÀrÓJˆØ×Ñœ˜S›Ð#6Ô7ãFˆKØ×#Ñ#¤G×$7Ñ$7¼×9IÑ9IÈ;ÓWˆCØ×ÑÜ�C”â)4ð7öó Gr   c                ó|   € R F5  p\        4       p\        P                  ! WR7      pV P                  W24       K7  	  R# )zS
When module import fails with ImportError it returns the specified
default value.
©ÚdefaultN)Únosuchmtopoduleúno.such.module)Úobjectr   ÚrequireModulerf   )r   ÚnamerŸ   r[   s   &   r   Útest_requireModuleImportErrorÚ*LookupsTests.test_requireModuleImportErrorG  s1   € ó
 :ˆDÜ“hˆGä×*Ò*¨4ÔAˆFà�M‰M˜&Ö*ó :r   c                óT   € \         P                  ! R4      pV P                  V4       R# )z9
When module import fails it returns L{None} by default.
r¡   N)r   r£   ÚassertIsNone)r   r[   s   & r   Útest_requireModuleDefaultNoneÚ*LookupsTests.test_requireModuleDefaultNoneS  s#   € ô ×&Ò&Ð'7Ó8ˆà×Ñ˜&Ö!r   c                óv   € ^ RI Hp \        4       pV P                  \        P
                  ! RVR7      V4       R# )zM
When module import succeed it returns the module and not the default
value.
rk   rm   rž   N)rn   rl   r¢   rf   r   r£   )r   rl   rŸ   s   &  r   Ú!test_requireModuleRequestedImportÚ.LookupsTests.test_requireModuleRequestedImport[  s.   € õ
 	*ä“(ˆà�‰Ü×!Ò!Ð"9À7ÔKØö	
r   r   N)r   r   r   r   r   rh   rq   ry   r|   r   r‚   r…   rŒ   r�   r›   r¥   r©   r¬   r   r   r   s   @r   rc   rc   ¶   sV   ø‡ € ñòVòLòJòIòTò
ò	
ò
ò*
ò*#òJ
+ò"÷
ð 
r   rc   c                   óL   a € ] tR tRt o RtRtV 3R lR ltV 3R lR ltRtV t	R# )	Ú	Breakableij  Fc                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn©r–   )Úformatr   s   "€r   Ú__annotate__ÚBreakable.__annotate__n  s   ø€ ÷ !ñ !™ñ !r   c                ó@   € V P                   '       d   \        R 4      hR# )zstr!z<Breakable>)ÚbreakStrÚRuntimeErrorr   s   &r   Ú__str__ÚBreakable.__str__n  s   € Ø�=�=ˆ=Ü˜vÓ&Ð&á r   c                ó    <€ V ^8„  d   QhRS[ /# r±   r´   )rµ   r   s   "€r   r¶   r·   t  s   ø€ ÷ !ñ !™#ñ !r   c                ó@   € V P                   '       d   \        R 4      hR# )zrepr!zBreakable())Ú	breakReprrº   r   s   &r   Ú__repr__ÚBreakable.__repr__t  s   € Ø�>�>ˆ>Ü˜wÓ'Ð'á r   r   N)
r   r   r   r   r¿   r¹   r»   rÀ   r   r   r   s   @r   r¯   r¯   j  s#   ø‡ € Ø€IØ€H÷!ð !÷!ö !r   r¯   c                   ó4   a € ] tR tRt o Rt]R 4       t RtV tR# )Ú
BrokenTypei{  Fc                ó@   € V P                   '       d   \        R 4      hR# )zno namerÃ   )Ú	breakNamerº   r   s   &r   r   ÚBrokenType.__name__~  s   € à�>�>ˆ>Ü˜yÓ)Ð)Ùr   r   N)r   r   r   r   rÅ   Úpropertyr   r   r   s   @r   rÃ   rÃ   {  s   ø‡ € Ø€Iàñó ör   rÃ   ÚBTBaser¿   Tr¹   c                   ó(   € ] tR tRt]! R 4      tRtR# )ÚNoClassAttriˆ  c                ó   € V P                   # rU   )Ú	not_class)r-   s   &r   Ú<lambda>ÚNoClassAttr.<lambda>‰  s   €  1§;¢;r   r   N)r   r   r   r   rÇ   Ú	__class__r   r   r   r   rÊ   rÊ   ˆ  s   † ÙÑ.Ó/„Ir   rÊ   c                   óT   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )ÚSafeReprTestsiŒ  z*
Tests for L{reflect.safe_repr} function.
c           	     ó¦   € . ROR3pV P                  \        \        \        P                  V4      4      \        \        \
        V4      4      4       R# )zO
L{reflect.safe_repr} produces the same output as C{repr} on a working
object.
ó   aN©é   r²   é   )r+   ÚlistÚmapr   Ú	safe_reprÚrepr)r   Úxss   & r   Útest_workingReprÚSafeReprTests.test_workingRepr‘  s;   € ò
 ˜ÐˆØ×Ñœœc¤'×"3Ñ"3°RÓ8Ó9¼4ÄÄDÈ"ÃÓ;NÖOr   c                ó  € \        4       pRVn        \        P                  ! V4      pV P	                  RV4       V P	                  \
        P                  P                  \        4      ^ ,          V4       V P	                  RV4       R# )zj
L{reflect.safe_repr} returns a string with class name, address, and
traceback when the repr call failed.
TzBreakable instance at 0xúRuntimeError: repr!N)	r¯   r¿   r   rÙ   ÚassertInÚosÚpathÚsplitextÚ__file__©r   ÚbÚbReprs   &  r   Útest_brokenReprÚSafeReprTests.test_brokenRepr™  sd   € ô
 ‹KˆØˆŒÜ×!Ò! !Ó$ˆØ�‰Ð0°%Ô8ð 	�‰”b—g‘g×&Ñ&¤xÓ0°Õ3°UÔ;Ø�‰Ð+¨UÖ3r   c                ó†   € \        4       pRVn        V P                  \        P                  ! V4      \        V4      4       R# )zD
L{reflect.safe_repr} isn't affected by a broken C{__str__} method.
TN)r¯   r¹   r+   r   rÙ   rÚ   ©r   ræ   s   & r   Útest_brokenStrÚSafeReprTests.test_brokenStr§  s1   € ô ‹KˆØˆŒ
Ø×Ñœ×*Ò*¨1Ó-¬t°A«wÖ7r   c                ó†   €  ! R  R\         4      p\        P                  ! V4       \        P                  ! V! 4       4       R# )c                   ó   € ] tR tRtRtRtR# )Ú-SafeReprTests.test_brokenClassRepr.<locals>.Xi°  Tr   N©r   r   r   r   r¿   r   r   r   r   ÚXrð   °  ó   † ØŒIr   rò   N©rÈ   r   rÙ   ©r   rò   s   & r   Útest_brokenClassReprÚ"SafeReprTests.test_brokenClassRepr¯  s.   € ô	”ô 	ô 	×Ò˜!ÔÜ×Ò™!›#Ör   c                ó¾   €  ! R R\         4      p\        P                  ! V4      pR\        V4      R R2pV P	                  W2P                  R4      ^ ,          4       R# )z«
C{id} is used to print the ID of the object in case of an error.

L{safe_repr} includes a traceback after a newline, so we only check
against the first line of the repr.
c                   ó   € ] tR tRtRtRtR# )Ú2SafeReprTests.test_brokenReprIncludesID.<locals>.Xi¾  Tr   Nrñ   r   r   r   rò   rú   ¾  ró   r   rò   z<BrokenType instance at 0xr-   z with repr error:Ú
N)rÈ   r   rÙ   Úidr+   Úsplit)r   rò   ÚxReprÚxReprExpecteds   &   r   Útest_brokenReprIncludesIDÚ'SafeReprTests.test_brokenReprIncludesID¶  sQ   € ô	”ô 	ô ×!Ò! !Ó$ˆØ4´R¸³U¸1°IÐ=NÐOˆØ×Ñ˜¯©°DÓ(9¸!Õ(<Ö=r   c                ó†   €  ! R  R\         4      p\        P                  ! V4       \        P                  ! V! 4       4       R# )c                   ó   € ] tR tRtRtRtR# )Ú,SafeReprTests.test_brokenClassStr.<locals>.XiÆ  Tr   N©r   r   r   r   r¹   r   r   r   r   rò   r  Æ  ó   † ØŒHr   rò   Nrô   rõ   s   & r   Útest_brokenClassStrÚ!SafeReprTests.test_brokenClassStrÅ  s.   € ô	”ô 	ô 	×Ò˜!ÔÜ×Ò™!›#Ör   c                ó  € \        4       pRVn        \        P                  ! V4      pV P	                  RV4       V P	                  \
        P                  P                  \        4      ^ ,          V4       V P	                  RV4       R# )z�
If an object raises an exception when accessing its C{__class__}
attribute, L{reflect.safe_repr} uses C{type} to retrieve the class
object.
TúNoClassAttr instance at 0xrß   N)	rÊ   r¿   r   rÙ   rà   rá   râ   rã   rä   rå   s   &  r   Útest_brokenClassAttributeÚ'SafeReprTests.test_brokenClassAttributeÌ  sb   € ô ‹MˆØˆŒÜ×!Ò! !Ó$ˆØ�‰Ð2°EÔ:Ø�‰”b—g‘g×&Ñ&¤xÓ0°Õ3°UÔ;Ø�‰Ð+¨UÖ3r   c                ó  €  ! R R\         4      p\        P                  ! V! 4       4      pV P                  RV4       V P                  \        P
                  P                  \        4      ^ ,          V4       V P                  RV4       R# )zÃ
If a class raises an exception when accessing its C{__name__} attribute
B{and} when calling its C{__str__} implementation, L{reflect.safe_repr}
returns 'BROKEN CLASS' instead of the class name.
c                   ó   € ] tR tRtRtRtR# )Ú6SafeReprTests.test_brokenClassNameAttribute.<locals>.Xià  Tr   N©r   r   r   r   rÅ   r   r   r   r   rò   r  à  ró   r   rò   ú<BROKEN CLASS AT 0xrß   N)rÈ   r   rÙ   rà   rá   râ   rã   rä   )r   rò   rþ   s   &  r   Útest_brokenClassNameAttributeÚ+SafeReprTests.test_brokenClassNameAttributeÙ  sb   € ô	”ô 	ô ×!Ò!¡!£#Ó&ˆØ�‰Ð+¨UÔ3Ø�‰”b—g‘g×&Ñ&¤xÓ0°Õ3°UÔ;Ø�‰Ð+¨UÖ3r   r   N)r   r   r   r   r   rÜ   rè   rì   rö   r   r  r  r  r   r   r   s   @r   rÑ   rÑ   Œ  s8   ø‡ € ñòPò4ò8òò>òò4÷4ð 4r   rÑ   c                   ó`   a € ] tR tRt o 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# )ÚSafeStrTestsié  z)
Tests for L{reflect.safe_str} function.
c                ól   € . ROpV P                  \        P                  ! V4      \        V4      4       R# )rÕ   NrÔ   )r+   r   Úsafe_strr–   ©r   r-   s   & r   Útest_workingStrÚSafeStrTests.test_workingStrî  s&   € ÚˆØ×Ñœ×)Ò)¨!Ó,¬c°!«fÖ5r   c                óT   € \        4       pR Vn        \        P                  ! V4       R# ©TN)r¯   r¹   r   r  rë   s   & r   rì   ÚSafeStrTests.test_brokenStrò  s   € Ü‹KˆØˆŒ
Ü×Ò˜Ör   c                óV   € RpV P                  \        P                  ! V4      R4       R# )zP
L{safe_str} for C{str} with ascii-only data should return the
value unchanged.
ÚaN)r+   r   r  r  s   & r   Útest_workingAsciiÚSafeStrTests.test_workingAscii÷  s$   € ð
 ˆØ×Ñœ×)Ò)¨!Ó,¨cÖ2r   c                ót   € RpV P                  \        P                  ! V4      VP                  R4      4       R# )z_
L{safe_str} for C{bytes} with utf-8 encoded data should return
the value decoded into C{str}.
s   tÃ¼stúutf-8N)r+   r   r  Údecoder  s   & r   Útest_workingUtf8_3ÚSafeStrTests.test_workingUtf8_3ÿ  s-   € ð
 ˆØ×Ñœ×)Ò)¨!Ó,¨a¯h©h°wÓ.?Ö@r   c                ól   € Rp\         P                  ! V4      pV P                  V\        V4      4       R# )z-
Use str() for non-utf8 bytes: "b'non-utf8'"
ó   ÿN)r   r  r+   r–   )r   r-   ÚxStrs   &  r   Útest_brokenUtf8ÚSafeStrTests.test_brokenUtf8  s-   € ð ˆÜ×Ò Ó"ˆØ×Ñ˜œs 1›vÖ&r   c                óT   € \        4       pR Vn        \        P                  ! V4       R# r  )r¯   r¿   r   r  rë   s   & r   rè   ÚSafeStrTests.test_brokenRepr  s   € Ü‹KˆØˆŒÜ×Ò˜Ör   c                ó†   €  ! R  R\         4      p\        P                  ! V4       \        P                  ! V! 4       4       R# )c                   ó   € ] tR tRtRtRtR# )Ú+SafeStrTests.test_brokenClassStr.<locals>.Xi  Tr   Nr  r   r   r   rò   r0    r  r   rò   N©rÈ   r   r  rõ   s   & r   r  Ú SafeStrTests.test_brokenClassStr  s.   € ô	”ô 	ô 	×Ò˜ÔÜ×Ò™›Ör   c                ó†   €  ! R  R\         4      p\        P                  ! V4       \        P                  ! V! 4       4       R# )c                   ó   € ] tR tRtRtRtR# )Ú,SafeStrTests.test_brokenClassRepr.<locals>.Xi  Tr   Nrñ   r   r   r   rò   r5    ró   r   rò   Nr1  rõ   s   & r   rö   Ú!SafeStrTests.test_brokenClassRepr  s.   € ô	”ô 	ô 	×Ò˜ÔÜ×Ò™›Ör   c                ó  € \        4       pRVn        \        P                  ! V4      pV P	                  RV4       V P	                  \
        P                  P                  \        4      ^ ,          V4       V P	                  RV4       R# )zŒ
If an object raises an exception when accessing its C{__class__}
attribute, L{reflect.safe_str} uses C{type} to retrieve the class
object.
Tr
  úRuntimeError: str!N)	rÊ   r¹   r   r  rà   rá   râ   rã   rä   )r   ræ   ÚbStrs   &  r   r  Ú&SafeStrTests.test_brokenClassAttribute"  sb   € ô ‹MˆØˆŒ
Ü×Ò Ó"ˆØ�‰Ð2°DÔ9Ø�‰”b—g‘g×&Ñ&¤xÓ0°Õ3°TÔ:Ø�‰Ð*¨DÖ1r   c                ó  €  ! R R\         4      p\        P                  ! V! 4       4      pV P                  RV4       V P                  \        P
                  P                  \        4      ^ ,          V4       V P                  RV4       R# )zÂ
If a class raises an exception when accessing its C{__name__} attribute
B{and} when calling its C{__str__} implementation, L{reflect.safe_str}
returns 'BROKEN CLASS' instead of the class name.
c                   ó   € ] tR tRtRtRtR# )Ú5SafeStrTests.test_brokenClassNameAttribute.<locals>.Xi6  Tr   Nr  r   r   r   rò   r=  6  ró   r   rò   r  r8  N)rÈ   r   r  rà   rá   râ   rã   rä   )r   rò   r)  s   &  r   r  Ú*SafeStrTests.test_brokenClassNameAttribute/  sb   € ô	”ô 	ô ×Ò¡£Ó$ˆØ�‰Ð+¨TÔ2Ø�‰”b—g‘g×&Ñ&¤xÓ0°Õ3°TÔ:Ø�‰Ð*¨DÖ1r   r   N)r   r   r   r   r   r  rì   r   r%  r*  rè   r  rö   r  r  r   r   r   s   @r   r  r  é  sB   ø‡ € ñò6òò
3òAò'òò
òò2÷2ð 2r   r  c                   ó<   a € ] tR tRt o RtR tR tR tR tRt	V t
R# )	ÚFilenameToModuleTestsi?  z)
Test L{filenameToModuleName} detection.
c                óŽ  € \         P                  P                  V P                  4       R R4      V n        \         P                  ! V P                  4       \        \         P                  P                  V P                  R4      R4      ;_uu_ 4       pVP                  R4       RRR4       \        \         P                  P                  \         P                  P                  V P                  4      R4      R4      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     L…; i  + '       g   i     R# ; i)ÚfakepackageÚtestz__init__.pyÚwr”   N)rá   râ   ÚjoinÚmktempÚmakedirsÚopenÚwriteÚdirname)r   Úfs   & r   ÚsetUpÚFilenameToModuleTests.setUpD  s¹   € Ü—G‘G—L‘L §¡£°¸vÓFˆŒ	Ü
�Š�D—I‘IÔÜ”"—'‘'—,‘,˜tŸy™y¨-Ó8¸#×>Ô>À!Ø�G‰G�BŒK÷ ?ä”"—'‘'—,‘,œrŸw™wŸ™¨t¯y©yÓ9¸=ÓIÈ3×OÔOÐSTØ�G‰G�BŒK÷ PÑO÷ ?×>úçO×OÐOús   ÂD ÄD3Ä D0	Ä3E	c                ó  € \         P                  ! V P                  4      pV P                  VR4       \         P                  ! V P                  \        P                  P
                  ,           4      pV P                  VR4       R# )zS
L{filenameToModuleName} returns the correct module (a package) given a
directory.
zfakepackage.testN)r   ÚfilenameToModuleNamerâ   r+   rá   Úsep©r   Úmodules   & r   Útest_directoryÚ$FilenameToModuleTests.test_directoryL  s[   € ô
 ×-Ò-¨d¯i©iÓ8ˆØ×Ñ˜Ð!3Ô4Ü×-Ò-¨d¯i©i¼"¿'¹'¿+¹+Õ.EÓFˆØ×Ñ˜Ð!3Ö4r   c                ó¦   € \         P                  ! \        P                  P	                  V P                  R4      4      pV P                  VR4       R# )zP
L{filenameToModuleName} returns the correct module given the path to
its file.
ztest_reflect.pyúfakepackage.test.test_reflectN)r   rO  rá   râ   rE  r+   rQ  s   & r   Ú	test_fileÚFilenameToModuleTests.test_fileV  s>   € ô
 ×-Ò-Ü�G‰G�L‰L˜Ÿ™Ð$5Ó6ó
ˆð 	×Ñ˜Ð!@ÖAr   c                óÄ   € \         P                  ! \        P                  P	                  V P                  P                  R4      R4      4      pV P                  VR4       R# )zW
L{filenameToModuleName} returns the correct module given a C{bytes}
path to its file.
r#  s   test_reflect.pyrV  N)r   rO  rá   râ   rE  Úencoder+   rQ  s   & r   Ú
test_bytesÚ FilenameToModuleTests.test_bytes`  sI   € ô
 ×-Ò-Ü�G‰G�L‰L˜Ÿ™×)Ñ)¨'Ó2Ð4FÓGó
ˆð 	×Ñ˜Ð!@ÖAr   )râ   N)r   r   r   r   r   rL  rS  rW  r[  r   r   r   s   @r   r@  r@  ?  s&   ø‡ € ñòò5òB÷	Bð 	Br   r@  c                   óN   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )ÚFullyQualifiedNameTestsil  z!
Test for L{fullyQualifiedName}.
c                ó<   € V P                  \        V4      V4       R# )zM
Helper to check that fully qualified name of C{obj} results to
C{expected}.
N)r+   r   )r   ÚobjÚexpecteds   &&&r   Ú_checkFullyQualifiedNameÚ0FullyQualifiedNameTests._checkFullyQualifiedNameq  s   € ð
 	×ÑÔ+¨CÓ0°(Ö;r   c                ór   € ^ RI pV P                  VR4       ^ RIpV P                  VP                  R4       R# )zL
L{fullyQualifiedName} returns the full name of a package and a
subpackage.
Nrx   rt   )rx   rb  rn   rv   rw   s   & r   Útest_packageÚ$FullyQualifiedNameTests.test_packagex  s/   € ó
 	à×%Ñ% g¨yÔ9Ûà×%Ñ% g§n¡nÐ6FÖGr   c                óZ   € ^ RI pV P                  VP                  P                  R4       R# )zF
L{fullyQualifiedName} returns the name of a module inside a package.
Nztwisted.python.compat)Útwisted.python.compatrb  rv   Úcompatrw   s   & r   Útest_moduleÚ#FullyQualifiedNameTests.test_module„  s"   € ó 	%à×%Ñ% g§n¡n×&;Ñ&;Ð=TÖUr   c                ó@   € V P                  \        \         R24       R# )zC
L{fullyQualifiedName} returns the name of a class and its module.
z.FullyQualifiedNameTestsN)rb  r^  r   r   s   &r   Ú
test_classÚ"FullyQualifiedNameTests.test_classŒ  s   € ð 	×%Ñ%Ü#¬ zÐ1IÐ%Jö	
r   c                ó2   € V P                  \        R4       R# )zI
L{fullyQualifiedName} returns the name of a function inside its module.
z)twisted.python.reflect.fullyQualifiedNameN)rb  r   r   s   &r   Útest_functionÚ%FullyQualifiedNameTests.test_function”  s   € ð 	×%Ñ%ÜÐ Kö	
r   c                óz   € V P                  V P                  \         RV P                  P                   R24       R# )z[
L{fullyQualifiedName} returns the name of a bound method inside its
class and its module.
Ú.z.test_boundMethodN)rb  Útest_boundMethodr   rÏ   r   s   &r   rt  Ú(FullyQualifiedNameTests.test_boundMethodœ  s7   € ð
 	×%Ñ%Ø×!Ñ!Üˆj˜˜$Ÿ.™.×1Ñ1Ð2Ð2CÐDö	
r   c                óŽ   € V P                  V P                  P                  \         RV P                  P                   R24       R# )z^
L{fullyQualifiedName} returns the name of an unbound method inside its
class and its module.
rs  z.test_unboundMethodN)rb  rÏ   Útest_unboundMethodr   r   s   &r   rw  Ú*FullyQualifiedNameTests.test_unboundMethod¦  s;   € ð
 	×%Ñ%Ø�N‰N×-Ñ-Üˆj˜˜$Ÿ.™.×1Ñ1Ð2Ð2EÐFö	
r   r   N)r   r   r   r   r   rb  re  rj  rm  rp  rt  rw  r   r   r   s   @r   r^  r^  l  s4   ø‡ € ñò<ò
HòVò
ò
ò
÷
ð 
r   r^  c                   óV   a € ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )ÚObjectGrepTestsi±  c                óþ   € \        4       pRV/pVR/pV P                  R\        P                  ! W!\        P                  4      4       V P                  R\        P                  ! W1\        P                  4      4       R# )zF
Test references search through a dictionary, as a key or as a value.
Nz[None]z{None}©r¢   rà   r   ÚobjgrepÚisSame)r   ÚoÚd1Úd2s   &   r   Útest_dictionaryÚObjectGrepTests.test_dictionary²  sW   € ô ‹HˆØ�AˆYˆØ�ˆYˆà�‰�h¤§¢°´w·~±~Ó FÔGØ�‰�h¤§¢°´w·~±~Ó FÖGr   c                óŒ   € \        4       pRV.pV P                  R\        P                  ! W!\        P                  4      4       R# )z(
Test references search through a list.
Nú[1]r|  )r   r  ÚLs   &  r   Ú	test_listÚObjectGrepTests.test_list½  s1   € ô ‹HˆØ�1ˆIˆà�‰�eœWŸ_š_¨Q´7·>±>ÓBÖCr   c                óŒ   € \        4       pVR3pV P                  R\        P                  ! W!\        P                  4      4       R# )z)
Test references search through a tuple.
Nú[0]r|  )r   r  ÚTs   &  r   Ú
test_tupleÚObjectGrepTests.test_tupleÆ  s1   € ô ‹HˆØ�ˆIˆà�‰�eœWŸ_š_¨Q´7·>±>ÓBÖCr   c                ó²   €  ! R R4      p\        4       pV! 4       pW#n        V P                  R\        P                  ! W2\        P
                  4      4       R# )z5
Test references search through an object attribute.
c                   ó   € ] tR tRtRtR# )Ú,ObjectGrepTests.test_instance.<locals>.DummyiÔ  r   NrG   r   r   r   ÚDummyr�  Ô  rI   r   r‘  z.oN)r¢   r  rà   r   r}  r~  )r   r‘  r  Úds   &   r   Útest_instanceÚObjectGrepTests.test_instanceÏ  s>   € ÷
	ñ 	ô ‹HˆÙ‹GˆØŒà�‰�dœGŸOšO¨A´'·.±.ÓAÖBr   c                ó¾   €  ! R R4      pV! 4       p\         P                  ! V4      pV P                  R\        P                  ! W2\        P
                  4      4       R# )z2
Test references search through a weakref object.
c                   ó   € ] tR tRtRtR# )Ú+ObjectGrepTests.test_weakref.<locals>.Dummyiâ  r   NrG   r   r   r   r‘  r—  â  rI   r   r‘  z()N)ÚweakrefÚrefrà   r   r}  r~  )r   r‘  r  Úw1s   &   r   Útest_weakrefÚObjectGrepTests.test_weakrefÝ  s?   € ÷
	ñ 	ñ ‹GˆÜ�[Š[˜‹^ˆà�‰�dœGŸOšO¨B´7·>±>ÓBÖCr   c                óÎ  €  ! R R4      pV! 4       pVP                   pV P                  R\        P                  ! W3P                  \        P
                  4      4       V P                  R\        P                  ! W3P                  P                  \        P
                  4      4       V P                  R\        P                  ! W3P                  \        P
                  4      4       R# )z;
Test references search through method special attributes.
c                   ó&   a € ] tR tRt o R tRtV tR# )Ú/ObjectGrepTests.test_boundMethod.<locals>.Dummyiï  c                ó   € R # rU   r   r   s   &r   ÚdummyÚ5ObjectGrepTests.test_boundMethod.<locals>.Dummy.dummyð  rX   r   r   N)r   r   r   r   r¡  r   r   r   s   @r   r‘  rŸ  ï  rY   r   r‘  z	.__self__z.__self__.__class__z	.__func__N)r¡  rà   r   r}  Ú__self__r~  rÏ   Ú__func__)r   r‘  r  Úms   &   r   rt  Ú ObjectGrepTests.test_boundMethodê  s�   € ÷
	ñ 	ñ ‹GˆØ�G‰Gˆà�‰�k¤7§?¢?°1·j±jÄ'Ç.Á.Ó#QÔRØ�‰Ø!Ü�OŠO˜AŸz™z×3Ñ3´W·^±^ÓDô	
ð 	�‰�k¤7§?¢?°1·j±jÄ'Ç.Á.Ó#QÖRr   c                ó0  €  ! R R4      pV! 4       pR
RRRVR/pRR
V^.pV/ V! 4       3p^ R^R^V/pV! 4       pWgn         VP                  p\        P                  ! V4      p	V P	                  R	\
        P                  ! W’\
        P                  4      4       R# )z6
Test references search using complex set of objects.
c                   ó&   a € ] tR tRt o R tRtV tR# )Ú.ObjectGrepTests.test_everything.<locals>.Dummyi  c                ó   € R # rU   r   r   s   &r   r   Ú5ObjectGrepTests.test_everything.<locals>.Dummy.method  rX   r   r   N)r   r   r   r   r   r   r   r   s   @r   r‘  r©    rY   r   r‘  ÚbazNÚQuuxÚFooshÚfooÚbarz"().__self__.attr[2][0][2]{'Foosh'}r   )Úattrr   r˜  r™  rà   r   r}  r~  )
r   r‘  r  ÚD1r†  r‹  ÚD2Úir¥  rD  s
   &         r   Útest_everythingÚObjectGrepTests.test_everythingý  s—   € ÷
	ñ 	ñ ‹GˆØ�%˜˜v q¨'Ð2ˆØ�2�r˜1ÐˆØ�‘E“GÐˆØ�˜˜5 ! QÐ'ˆÙ‹GˆØŒØ�H‰HˆÜ�KŠK˜‹Nˆà�‰Ø0´'·/²/À!ÌÏÉÓ2Wö	
r   c           
     óp  € . pV.pW.pW.pV P                  R.\        P                  ! WA\        P                  ^R7      4       V P                  RR.\        P                  ! WA\        P                  ^R7      4       V P                  . RO\        P                  ! WA\        P                  ^R7      4       R# )z&
Test the depth of references search.
rŠ  )ÚmaxDepthú[1][0]N)rŠ  r¹  z	[1][1][0])r+   r   r}  r~  )r   r  ræ   Úcr’  s   &    r   Útest_depthLimitÚObjectGrepTests.test_depthLimit  s’   € ð ˆØˆCˆØˆFˆØˆFˆà×Ñ˜%˜¤'§/¢/°!¼¿¹ÐQRÔ"SÔTØ×ÑØ�HÐœwŸš¨q´W·^±^ÈaÔPô	
ð 	×ÑÚ*Ü�OŠO˜A¤'§.¡.¸1Ô=ö	
r   c                óÜ   € \        4       p\        4       pVP                  R4       VP                  V4       V P                  R\        P
                  ! W!\        P                  4      4       R# )z0
Test references search through a deque object.
Nr…  )r¢   r   Úappendrà   r   r}  r~  )r   r  ÚDs   &  r   Ú
test_dequeÚObjectGrepTests.test_deque&  sE   € ô ‹HˆÜ‹GˆØ	�‰�ŒØ	�‰�Œà�‰�eœWŸ_š_¨Q´7·>±>ÓBÖCr   r   N)r   r   r   r   r‚  r‡  rŒ  r“  r›  rt  rµ  r»  rÀ  r   r   r   s   @r   rz  rz  ±  s?   ø‡ € ò	HòDòDòCòDòSò&
ò.
÷$	Dð 	Dr   rz  c                   ó&   a € ] tR tRt o R tRtV tR# )ÚGetClassTestsi2  c                óè   €  ! R  R4      pV! 4       pV P                  \        P                  ! V4      P                  R4       V P                  \        P                  ! V4      P                  R4       R# )c                   ó   € ] tR tRtRtR# )Ú(GetClassTests.test_new.<locals>.NewClassi4  r   NrG   r   r   r   ÚNewClassrÆ  4  rI   r   rÇ  ÚtypeN)r+   r   ÚgetClassr   )r   rÇ  Únews   &  r   Útest_newÚGetClassTests.test_new3  sW   € ÷	ñ 	ñ ‹jˆØ×Ñœ×)Ò)¨(Ó3×<Ñ<¸fÔEØ×Ñœ×)Ò)¨#Ó.×7Ñ7¸ÖDr   r   N)r   r   r   r   rË  r   r   r   s   @r   rÃ  rÃ  2  s   ø‡ € ÷Eð Er   rÃ  )$r   rá   r˜  Úcollectionsr   rn   r   Útwisted.python.reflectr   r   r   r   r   Útwisted.trial.unittestr	   ÚTestCaser   r   r!   r)   r9   r@   rM   r^   rc   r¯   rÈ  rÃ   rÈ   rÊ   rÑ   r  r@  r^  rz  rÃ  r   r   r   Ú<module>rÑ     s.  ðñó
 
Û Ý å "÷õ õ C÷	ñ 	ôˆ$ô ÷ñ ô &<˜Xô &<ôR2˜8ô 2ô2J˜xô Jô03 ô 3÷.ñ ôq
�8ô q
÷h!ñ !ô"�˜Dô ñ 
�H˜y˜l¨[¸$À
ÈDÐ,QÓ	R€ô0�)ô 0ôZ4�Hô Z4ôzS2�8ô S2ôl*B˜Hô *BôZB
˜hô B
ôJ~D�hô ~DôBE�Hö Er   