Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/unittest/test/testmock/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/unittest/test/testmock/__pycache__/testcallable.cpython-39.opt-2.pyc

a

��g��@sfddlZddlmZmZmZddlmZmZmZm	Z	m
Z
mZmZGdd�dej
�Zedkrbe��dS)�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.9/unittest/test/testmock/testcallable.py�assertNotCallableszTestCallable.assertNotCallablecCsFt�t�fD]4}|�t|�|�t|d��|�|jjt	|��qdS)N�__call__)
rr�assertRaises�	TypeErrorr�hasattrZassertIn�	__class__�__name__�reprrrrr�test_non_callableszTestCallable.test_non_callablecCs$|�ttt��|�ttt��dSr
)r�
issubclassrrrr�rrrr�test_hierarchyszTestCallable.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@seZdZdS)z-TestCallable.test_subclasses.<locals>.MockSubN�r�
__module__�__qualname__rrrr�MockSub,sr(c@seZdZdS)z.TestCallable.test_subclasses.<locals>.MagicSubNr%rrrr�MagicSub2sr))rrrr!r"rr#)rr(r"r)r#rrr�test_subclasses+szTestCallable.test_subclassescCsLtdtdd�}|��}|�|j�|�}|��|�|�|�t|�dS)N�%s.XT��spec�	r	r�start�
addCleanup�stop�assert_called_once_withrrr�r�patcherr�instancerrr�test_patch_spec9s
zTestCallable.test_patch_speccCsLtdtdd�}|��}|�|j�|�}|��|�|�|�t|�dS)Nr+T��spec_setr.r3rrr�test_patch_spec_setEs
z TestCallable.test_patch_spec_setcCs@tdtt�d�}|��}|�|j�|�|�|�t|�dS)Nr+r,�	r	rrr/r0r1rrr�rr4rrrr�test_patch_spec_instanceQs

z%TestCallable.test_patch_spec_instancecCs@tdtt�d�}|��}|�|j�|�|�|�t|�dS)Nr+r7r:r;rrr�test_patch_spec_set_instanceZs

z)TestCallable.test_patch_spec_set_instancec	
Cs�Gdd�dt�}Gdd�d|�}Gdd�dt|�}dD]�}|||fD]�}tdtfi||i����}|�}|��|�t|t��|�t	t
|d	�|�}|��|d
dd�|�d
dd�|�d
dd�|j�d
dd�Wd�qD1s�0YqDq6dS)
Nc@seZdZdd�ZdS)z>TestCallable.test_patch_spec_callable_class.<locals>.CallableXcSsdSr
rrrrrre�zGTestCallable.test_patch_spec_callable_class.<locals>.CallableX.__call__N)rr&r'rrrrr�	CallableXdsr?c@seZdZdS)z8TestCallable.test_patch_spec_callable_class.<locals>.SubNr%rrrr�Subgsr@c@seZdZdS)z:TestCallable.test_patch_spec_callable_class.<locals>.MultiNr%rrrr�MultijsrA)r-r8r+Z	foobarbaz���)rrr	rr2rrrr�AttributeError�getattrZfoo)	rr?r@rA�argZKlassrr5�resultrrr�test_patch_spec_callable_classcs$
�z+TestCallable.test_patch_spec_callable_classcCs4tt�}|�}|�t|�tt��}|�t|�dSr
)r
rrr)rrr5rrr�test_create_autospec�s

z!TestCallable.test_create_autospeccCs@ttdd�}|�t|�|��|j��|�t|jdd�dS)NT)r5Zsome�args)r
rrrZwibbler2rrrr�test_create_autospec_instance�s

z*TestCallable.test_create_autospec_instanceN)rr&r'rrr r$r*r6r9r<r=rIrJrLrrrrrs			r�__main__)ZunittestZunittest.test.testmock.supportrrrZ
unittest.mockrrrrr	r
rZTestCaserr�mainrrrr�<module>s$

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists