[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.223.239.65: ~ $


�n�UO�@s�ddlZddlmZmZmZddlmZmZm	Z	m
Z
mZmZm
Z
Gdd�dej�Zedkr�ej�dS)�N)�is_instance�X�	SomeClass)�Mock�	MagicMock�NonCallableMagicMock�NonCallableMock�patch�create_autospec�
CallableMixinc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�TestCallablecCs0|jt|t��|jt|t��dS)N)�
assertTruerr�assertFalser)�self�mock�r�/testcallable.py�assertNotCallableszTestCallable.assertNotCallablecCscx\t�t�fD]H}|jt|�|jt|d��|j|jjt	|��qWdS)N�__call__)
rr�assertRaises�	TypeErrorr�hasattrZassertIn�	__class__�__name__�repr)rrrrr�test_non_callableszTestCallable.test_non_callablecCs0|jttt��|jttt��dS)N)r
�
issubclassrrrr)rrrr�test_heirarchyszTestCallable.test_heirarchycCsTt�}|jtt|j�t��t�}|jtt|j�t��dS)N)	rr
r�type�onerr�twor)rrr rrr�test_attributes#s		zTestCallable.test_attributescCs�Gdd�dt�}|�}|jtt|j�|��Gdd�dt�}|�}|jtt|j�|��dS)Nc@seZdZdS)z-TestCallable.test_subclasses.<locals>.MockSubN)r�
__module__�__qualname__rrrr�MockSub,sr$c@seZdZdS)z.TestCallable.test_subclasses.<locals>.MagicSubN)rr"r#rrrr�MagicSub2sr%)rr
rrrrr )rr$rr%r rrr�test_subclasses+s		zTestCallable.test_subclassescCsftdtdd�}|j�}|j|j�|�}|j�|j|�|jt|�dS)Nz%s.X�specT)	r	r�start�
addCleanup�stop�assert_called_once_withrrr)r�patcherr�instancerrr�test_patch_spec9s	

zTestCallable.test_patch_speccCsftdtdd�}|j�}|j|j�|�}|j�|j|�|jt|�dS)Nz%s.X�spec_setT)	r	rr(r)r*r+rrr)rr,rr-rrr�test_patch_spec_setEs	

z TestCallable.test_patch_spec_setcCsVtdtdt��}|j�}|j|j�|j|�|jt|�dS)Nz%s.Xr')	r	rrr(r)r*rrr)rr,rrrr�test_patch_spec_instanceQs

z%TestCallable.test_patch_spec_instancecCsVtdtdt��}|j�}|j|j�|j|�|jt|�dS)Nz%s.Xr/)	r	rrr(r)r*rrr)rr,rrrr�test_patch_spec_set_instanceZs

z)TestCallable.test_patch_spec_set_instancecCsdGdd�dt�}Gdd�d|�}Gdd�dt|�}Gdd�d�}Gd	d
�d
|�}x�dD]�}x�|||||fD]�}td
t||i���}|�}	|j�|jt|	t��|jt	t
|	d�|	�}
|	j�|
ddd�|
jddd�|
jddd�|
jjddd�WdQRXq�WquWdS)Nc@seZdZdd�ZdS)z>TestCallable.test_patch_spec_callable_class.<locals>.CallableXcSsdS)Nr)rrrrreszGTestCallable.test_patch_spec_callable_class.<locals>.CallableX.__call__N)rr"r#rrrrr�	CallableXdsr3c@seZdZdS)z8TestCallable.test_patch_spec_callable_class.<locals>.SubN)rr"r#rrrr�Subhsr4c@seZdZdS)z:TestCallable.test_patch_spec_callable_class.<locals>.MultiN)rr"r#rrrr�Multiksr5c@seZdZdd�ZdS)z=TestCallable.test_patch_spec_callable_class.<locals>.OldStylecSsdS)Nr)rrrrroszFTestCallable.test_patch_spec_callable_class.<locals>.OldStyle.__call__N)rr"r#rrrrr�OldStylensr6c@seZdZdS)z@TestCallable.test_patch_spec_callable_class.<locals>.OldStyleSubN)rr"r#rrrr�OldStyleSubrsr7r'r/z%s.XZ	foobarbaz���)zspeczspec_set)rrr	rr+r
rrr�AttributeError�getattrZfoo)rr3r4r5r6r7�argZKlassrr-�resultrrr�test_patch_spec_callable_classcs&
	
	
z+TestCallable.test_patch_spec_callable_classcCsHtt�}|�}|jt|�tt��}|jt|�dS)N)r
rrr)rrr-rrr�test_create_autospec�s
	z!TestCallable.test_create_autospeccCsVttdd�}|jt|�|j�|jj�|jt|jdd�dS)Nr-TZsome�args)r
rrrZwibbler+)rrrrr�test_create_autospec_instance�s


z*TestCallable.test_create_autospec_instanceN)rr"r#rrrr!r&r.r0r1r2r?r@rBrrrrrs		'	r�__main__)Z	unittest2ZunittestZmock.tests.supportrrrrrrrrr	r
rZTestCaserr�mainrrrr�<module>s
4�

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 95 B 0644
__init__.cpython-35.pyc File 95 B 0644
__main__.cpython-35.opt-1.pyc File 569 B 0644
__main__.cpython-35.pyc File 569 B 0644
support.cpython-35.opt-1.pyc File 1.17 KB 0644
support.cpython-35.pyc File 1.17 KB 0644
testcallable.cpython-35.opt-1.pyc File 5.98 KB 0644
testcallable.cpython-35.pyc File 5.98 KB 0644
testhelpers.cpython-35.opt-1.pyc File 36.11 KB 0644
testhelpers.cpython-35.pyc File 36.11 KB 0644
testmagicmethods.cpython-35.opt-1.pyc File 22.61 KB 0644
testmagicmethods.cpython-35.pyc File 22.61 KB 0644
testmock.cpython-35.opt-1.pyc File 49.25 KB 0644
testmock.cpython-35.pyc File 49.25 KB 0644
testpatch.cpython-35.opt-1.pyc File 71.85 KB 0644
testpatch.cpython-35.pyc File 71.85 KB 0644
testsentinel.cpython-35.opt-1.pyc File 1.38 KB 0644
testsentinel.cpython-35.pyc File 1.38 KB 0644
testwith.cpython-35.opt-1.pyc File 10.14 KB 0644
testwith.cpython-35.pyc File 10.14 KB 0644