HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/unittest/test/testmock/__pycache__/testcallable.cpython-310.pyc
o

�i��@sjddlZddlmZmZmZddlmZmZmZm	Z	m
Z
mZmZGdd�dej
�Zedkr3e��dSdS)�N)�is_instance�X�	SomeClass)�Mock�	MagicMock�NonCallableMagicMock�NonCallableMock�patch�create_autospec�
CallableMixinc@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�TestCallablecCs$|�t|t��|�t|t��dS�N)�
assertTruerr�assertFalser��self�mock�r�@/usr/local/lib/python3.10/unittest/test/testmock/testcallable.py�assertNotCallable�zTestCallable.assertNotCallablecCsFt�t�fD]}|�t|�|�t|d��|�|jjt	|��qdS)N�__call__)
rr�assertRaises�	TypeErrorr�hasattrZassertIn�	__class__�__name__�reprrrrr�test_non_callables
�zTestCallable.test_non_callablecCs$|�ttt��|�ttt��dSr
)r�
issubclassrrrr�rrrr�test_hierarchyrzTestCallable.test_hierarchycCs<t�}|�tt|j�t��t�}|�tt|j�t��dSr
)	rrr�type�onerr�twor)rr#r$rrr�test_attributes#szTestCallable.test_attributescCs\Gdd�dt�}|�}|�tt|j�|��Gdd�dt�}|�}|�tt|j�|��dS)Nc@�eZdZdS)z-TestCallable.test_subclasses.<locals>.MockSubN�r�
__module__�__qualname__rrrr�MockSub,�r*c@r&)z.TestCallable.test_subclasses.<locals>.MagicSubNr'rrrr�MagicSub2r+r,)rrrr"r#rr$)rr*r#r,r$rrr�test_subclasses+szTestCallable.test_subclassescC�Ltdtdd�}|��}|�|j�|�}|��|�|�|�t|�dS)N�%s.XT��spec�	r	r�start�
addCleanup�stop�assert_called_once_withrrr�r�patcherr�instancerrr�test_patch_spec9�
zTestCallable.test_patch_speccCr.)Nr/T��spec_setr2r7rrr�test_patch_spec_setEr;z TestCallable.test_patch_spec_setcC�@tdtt�d�}|��}|�|j�|�|�|�t|�dS)Nr/r0�	r	rrr3r4r5rrr�rr8rrrr�test_patch_spec_instanceQ�

z%TestCallable.test_patch_spec_instancecCr?)Nr/r<r@rArrr�test_patch_spec_set_instanceZrCz)TestCallable.test_patch_spec_set_instancec	
Cs�Gdd�dt�}Gdd�d|�}Gdd�dt|�}dD]`}|||fD]X}tdtfi||i���B}|�}|��|�t|t��|�t	t
|d	�|�}|��|d
dd�|�d
dd�|�d
dd�|j�d
dd�Wd�n1suwYq"qdS)
Nc@seZdZdd�ZdS)z>TestCallable.test_patch_spec_callable_class.<locals>.CallableXcSsdSr
rr rrrreszGTestCallable.test_patch_spec_callable_class.<locals>.CallableX.__call__N)rr(r)rrrrr�	CallableXdsrEc@r&)z8TestCallable.test_patch_spec_callable_class.<locals>.SubNr'rrrr�Subgr+rFc@r&)z:TestCallable.test_patch_spec_callable_class.<locals>.MultiNr'rrrr�Multijr+rG)r1r=r/Z	foobarbaz���)rrr	rr6rrrr�AttributeError�getattrZfoo)	rrErFrG�argZKlassrr9�resultrrr�test_patch_spec_callable_classcs,
�����z+TestCallable.test_patch_spec_callable_classcCs4tt�}|�}|�t|�tt��}|�t|�dSr
)r
rrr)rrr9rrr�test_create_autospec�s

z!TestCallable.test_create_autospeccCs@ttdd�}|�t|�|��|j��|�t|jdd�dS)NT)r9Zsome�args)r
rrrZwibbler6rrrr�test_create_autospec_instance�s

z*TestCallable.test_create_autospec_instanceN)rr(r)rrr!r%r-r:r>rBrDrOrPrRrrrrrs			r�__main__)ZunittestZunittest.test.testmock.supportrrrZ
unittest.mockrrrrr	r
rZTestCaserr�mainrrrr�<module>s$�