[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.4.5: ~ $


�?�Vp�@sddlZddlZddlmZmZmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZGdd�de�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�dej�Zedkrej�dS)�N)�call�create_autospec�	MagicMock�Mock�ANY�patch�PropertyMock)�_Call�	_CallList)�datetimec@s7eZdZdd�Zdd�Zddd�ZdS)�	SomeClasscCsdS)N�)�self�a�br
r
�/testhelpers.py�onesz
SomeClass.onecCsdS)Nr
)rr
r
r�twosz
SomeClass.twoNcCsdS)Nr
)rrr
r
r�threeszSomeClass.three)�__name__�
__module__�__qualname__rrrr
r
r
rrsrc@s@eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�AnyTestcCs]|jtt��t�}|t�|jt�t�}|dt�|jdt�dS)N�foo)�assertEqualr�objectr�assert_called_with)r�mockr
r
r�test_anys	

	
zAnyTest.test_anycCs0|jtt�d�|jtt�d�dS)Nz<ANY>)r�reprr�str)rr
r
r�	test_repr'szAnyTest.test_reprcCs<t�}|tj�dtj��|jtdt�dS)Nr)rr�nowrr)rrr
r
r�test_any_and_datetime,s	zAnyTest.test_any_and_datetimec	Cst�}tj�}Gdd�dt�}x�tj�|�fD]�}|j�||d|d|�|j|d|d|�|�jd|d|�ttdtdt�tjtdtdt�t�t�jdtdt�g}|j||j	�|j|j	|�qAWdS)	Nc@s(eZdZdd�Zdd�ZdS)z9AnyTest.test_any_mock_calls_comparison_order.<locals>.FoocSsdS)NFr
)r�otherr
r
r�__eq__7sz@AnyTest.test_any_mock_calls_comparison_order.<locals>.Foo.__eq__cSsdS)NTr
)rr$r
r
r�__ne__9sz@AnyTest.test_any_mock_calls_comparison_order.<locals>.Foo.__ne__N)rrrr%r&r
r
r
r�Foo6sr'r�barZzinga�alphaZa1Zz99)
rrr"r�
reset_mock�methodrrr�
mock_calls)rr�dr'�expectedr
r
r�$test_any_mock_calls_comparison_order3s	
$z,AnyTest.test_any_mock_calls_comparison_orderN)rrrrr!r#r/r
r
r
rrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�CallTestcCs�t�}|j|t��|j|td��|j|tff��|j|tif��|j|tdff��|j|tdif��|j|tdfif��|j|td��|j|tdff��|j|tdif��|j|tdfif��td�}|j|td��|j|td��|j|tdif��|j|tddif��td�}|j|td��|j|tddif��td�}|j|td��|j|tddif��|j|td ��|j|tdd!if��td
dif�}|j|tdfd
dif��|j|tdd
dif��|j|tfd
dif��|j|td
dif��dS)"N�rr(�bazZspam����r)r1)�foo�r3r4r5)r8�r3r4r5)r9�r3r4r5)r1r:)r3r4r5)r3r4r5�r3r4r6)r;�r3r4r5)r1r<)r3r4r5�r3r4r6)r7r=�r3r4r6)r1r>)r3r4r6�r3r4r6)zbarr?)r3r4r6)r	r�assertNotEqual)r�kallr
r
r�test_call_with_callOs<	%""zCallTest.test_call_with_callcCs�t�}|j|f�|j|d�|j|ff�|j|dff�|j|dfif�|j|dif�|j|if�dS)Nr)zfoo)r	r)r�argsr
r
r�test_empty__Callts	zCallTest.test_empty__CallcCs�tdfif�}|j|d�|j|dff�|j|dfif�|j|dif�|j|ff�|j|f�|j|if�|j|d�|j|dff�|j|dif�dS)Nrr()zfoo)zbar)r	rr@)rrCr
r
r�test_named_empty_call�szCallTest.test_named_empty_callcCsetdif�}|j|d�|j|d	�|j|dd
if�|j|dif�dS)Nr3r4r5r)r3r4r5�r3r4r5)rF�r3r4r5)zfoorG)r3r4r5)r3r4r5)r	r)rrCr
r
r�test_call_with_args�s
zCallTest.test_call_with_argscCshtddif�}|j|d�|j|ddif�|j|d
�|j|dif�dS)Nrr3r4r5)r3r4r5�r3r4r5)zfoorI)r3r4r5�r3r4r5)rJ)r3r4r5)r	rr@)rrCr
r
r�test_named_call_with_args�s
z"CallTest.test_named_call_with_argsc	Cs�tftdddd�f�}|j|tdddd�f�|j|dtdddd�f�|j|dftdddd�f�|j|ftdddd�f�dS)Nrr5rr6r)r	�dictr)rrCr
r
r�test_call_with_kwargs�s
!"%(zCallTest.test_call_with_kwargsc	Cs�tdftdddd�f�}|j|dtdddd�f�|j|dftdddd�f�|j|tdddd�f�|j|ftdddd�f�dS)Nrrr5rr6)r	rLrr@)rrCr
r
r�test_named_call_with_kwargs�s
$%("z$CallTest.test_named_call_with_kwargscCsmtdif�}|j|tddd��|jtddd�|�|jtddd�|g�dS)Nr3r4r5)r3r4r5)r	rr�assertIn)rrCr
r
r�#test_call_with_args_call_empty_name�sz,CallTest.test_call_with_args_call_empty_namecCss|jtd�tdd��|jtd�tddd�k�|jtdif�tddd�k�dS)	Nr3r4r5�r3r4r5)rQ�r3r4r5)rR)r3r4)r@r	r�assertFalseZ
assertTrue)rr
r
r�test_call_ne�s%zCallTest.test_call_necCsPtd�}x=dd|tfD])}|j||�|j||k�qWdS)Nr3r4r5�r3r4r5)rU)r	�intr@rS)rrA�valuer
r
r�test_call_non_tuples�szCallTest.test_call_non_tuplescCs�|jtt��d�|jttd��d�|jttdddif��d	�|jttd
dddif��d�|jtt�d�|jtt�d�|jtt��d�|jttd��d
�|jttdd��d�|jtt�j�d�|jttd�jjdd�j�d�|jtt�jdddd��d�|jtt���d�|jttd�d��d�|jtt��j�jj	d��d�dS)Nzcall()rz
call.foo()r3r4r5rrzcall(1, 2, 3, a='b')r(zcall.bar(1, 2, 3, a='b')rzcall(1)�zz�thingzcall(zz='thing')z
call().foozcall().foo.bar().bingzcall().foo(1, 2, a=3)zcall()()z	call()(2)zcall()().bar().baz.beep(1))zfoo)r3r4r5)r3r4r5)
rrr	rr rr(�bingr2�beep)rr
r
rr!�s,!$'"!zCallTest.test_reprcCs�|jt�dfif�|jtdddddd�dd
ddddif�t�}|dd	d�|d
ddd�|j|jtdd	d�td
ddd�g�dS)Nr1rr(rr5rr6r3r4rr�)zfoozbar)rrr�call_args_list)rrr
r
r�	test_call�s	zCallTest.test_callcCs�|jtjd�ddif�|jtjjdd�dfddif�t�}|jddd�|jjddd	d
�|j|jtjddd�tjjddd	d
�g�dS)Nr3r�fishZeggszbar.bazr4r5rrr])r3)rrrr(r2r�method_calls)rrr
r
r�test_attribute_call�s"	zCallTest.test_attribute_callc	Cs�td�jd�jddd�}|j|dd	tdd�f�t�}|dddddd�|j|jtdddddd��|j|jtddd��|j|jtdddddd�g�|j|j	tdddddd�g�t�}|jd�j��j
jdd�tjd�j��j
jdd�}|j|j	d
|�|j|j	|j��dS)Nr3r4r5rr6z().foo().barrr])r5���)
rrr(rrLr�	call_argsr@r^r,r2r\�	call_list)r�resultrZ	last_callr
r
r�test_extended_calls$"	(++	%'zCallTest.test_extended_callcCsVt�}|d�|jtd�j�|j�t�}|d�jd�|jtd�jd�j�|j�t�}|d�jd�d�|jtd�jd�d�j�|j�t�}t|d�jd�d�jjj	d�d��td�jd�d�jjj	d�d�j
�}|j|j�|j�dS)Nr3r4r5r6�)rrrrer,r+rVrr(r2�__int__)rrrAr
r
r�test_call_lists	
	
	$
	46zCallTest.test_call_listcCsS|jtt�t�}t|�|j|jtg�|jtg|j�dS)N)rrrrrVr,)r�mr
r
r�
test_call_any)s
	
zCallTest.test_call_anycCs�tdddifdd�}|jt|�d�|j|dd	�|j|dddi�td
ddif�}|j||�dS)Nr3r4rr5rTr)r3r4)r3r4)r3r4)r	r�len)rrCZ
other_argsr
r
r�test_two_args_call2szCallTest.test_two_args_callN)rrrrBrDrErHrKrMrNrPrTrXr!r_rbrgrjrlrnr
r
r
rr0Ms"%	
	
	r0c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zej	dd��Z
d
d�Zeje
jd�dd��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zeje
jd"�d#d$��Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Z eje
jd3�d4d5��Z!d6d7�Z"eje
jd3�d8d9��Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(dDdE�Z)dFS)G�SpecSignatureTestcCs>|jtt|d�|jdd�|jjdd�|jt|jjdd�|jt|jd�|j�|jj�|jt|jjd�|jt|jd�|j�|jj�|jt|jjd�|jt|jdd�|jd�|jjd�|jdd�|jjdd�dS)Nrr3r4r5r6r)	�assertRaises�AttributeError�getattrrr�AssertionError�	TypeErrorrr)rrr
r
r�_check_someclass_mock>s(	

	

	
z'SpecSignatureTest._check_someclass_mockcCs9tt�}|j|�tt��}|j|�dS)N)rrru)rrr
r
r�
test_basicYs
zSpecSignatureTest.test_basiccCspdd�}t|dd�}|j|�d�Gdd�dt�}t|dd�}|j|�d�dS)NcSsdS)Nr
r
r
r
r�fasz>SpecSignatureTest.test_create_autospec_return_value.<locals>.fZreturn_valuerc@seZdZdS)z@SpecSignatureTest.test_create_autospec_return_value.<locals>.FooN)rrrr
r
r
rr'fsr')rrr)rrwrr'r
r
r�!test_create_autospec_return_value`sz3SpecSignatureTest.test_create_autospec_return_valuecCs:tt�}t|�|j�|j|jjd�dS)Nr)rrVr*rriZ
call_count)rrkr
r
r�test_autospec_reset_mockms

z*SpecSignatureTest.test_autospec_reset_mockcCsUGdd�dt�}tj|d�}|j�}|�jd�|jd�dS)Nc@seZdZdd�ZdS)z;SpecSignatureTest.test_mocking_unbound_methods.<locals>.FoocSsdS)Nr
)rrr
r
rrvsz?SpecSignatureTest.test_mocking_unbound_methods.<locals>.Foo.fooN)rrrrr
r
r
rr'usr'rr3)rr�startrr)rr'�pZmock_foor
r
r�test_mocking_unbound_methodsts
z.SpecSignatureTest.test_mocking_unbound_methodscCsuGdd�dt�}t|�}|�}|jt|jd�|jd�|jjd�|jt|j�dS)Nc@seZdZdd�ZdS)zCSpecSignatureTest.test_create_autospec_unbound_methods.<locals>.FoocSsdS)Nr
)rr
r
rr�szGSpecSignatureTest.test_create_autospec_unbound_methods.<locals>.Foo.fooN)rrrrr
r
r
rr'�sr'r3)rrrprtrr)rr'�klass�instancer
r
r�$test_create_autospec_unbound_methodss	
z6SpecSignatureTest.test_create_autospec_unbound_methodscCs?Gdd�dt�}t|dd�}|j|jd�dS)Nc@seZdZdZdS)zESpecSignatureTest.test_create_autospec_keyword_arguments.<locals>.Foor5N)rrrrr
r
r
rr'�sr'r�3)rrrr)rr'rkr
r
r�&test_create_autospec_keyword_arguments�sz8SpecSignatureTest.test_create_autospec_keyword_argumentsz(Keyword only arguments Python 3 specificcCs�d}i}t||�|d}t|�}|d�|jd�|jt|dd�|ddd�|jddd�dS)Nz def foo(a, *, b=None):
    pass
rr3r4rr5)�execrrrprt)rZfunc_def�	namespacerrkr
r
r�+test_create_autospec_keyword_only_arguments�s



z=SpecSignatureTest.test_create_autospec_keyword_only_argumentscCsKt�}dd�}||_t|�}|jd�|jjd�dS)NcSsdS)Nr
)rr
r
rrw�sz@SpecSignatureTest.test_function_as_instance_attribute.<locals>.fr[)rrwrr)r�objrwrr
r
r�#test_function_as_instance_attribute�s		
z5SpecSignatureTest.test_function_as_instance_attributecCs�tg�}|jd�|jjd�|jtt|d�Gdd�dt�}t|�}|jjd�|jjjd�|jtt|jd�dS)Nrc@seZdZgZdS)z0SpecSignatureTest.test_spec_as_list.<locals>.FooN)rrrrr
r
r
rr'�sr'r5)r�appendrrprqrrrr)rrr'r
r
r�test_spec_as_list�s
z#SpecSignatureTest.test_spec_as_listcCsMGdd�dt�}t|�}x$||jfD]}|j|�q2WdS)Nc@seZdZe�ZdS)z.SpecSignatureTest.test_attributes.<locals>.SubN)rrrr�attrr
r
r
r�Sub�sr�)rrr�ru)rr�Zsub_mockrr
r
r�test_attributes�sz!SpecSignatureTest.test_attributescCs)Gdd�dt�}t|�}|jd�|jjd�|jtt|jd�|jd�|jjd�|jt|jdd�|jtt|jd�|j	ddg�|j	jddg�|jtt|j	d�|j
jd�|j
jjd�|jtt|j
d�dS)Nc@s(eZdZdd�ZeZiZdS)zGSpecSignatureTest.test_builtin_functions_types.<locals>.BuiltinSubclasscSsdS)Nr
)r�argr
r
rr(�szKSpecSignatureTest.test_builtin_functions_types.<locals>.BuiltinSubclass.barN)rrrr(�sortedr�r
r
r
r�BuiltinSubclass�sr�r5rr(r3r4)�listrr�rrprqrrr(rtr�r��pop)rr�rr
r
r�test_builtin_functions_types�s

z.SpecSignatureTest.test_builtin_functions_typescCsGdd�dt�}t|�}|jdd�|j�|jd�tjdd�tj�tjd�g}|j|j|�|jjdd�|jj�|jjd�|j	tjjdd�tjj�tjjd�g�|j|j|�dS)Nc@seZdZe�ZdS)z0SpecSignatureTest.test_method_calls.<locals>.SubN)rrrrr�r
r
r
rr��sr�r3r4r5)
rrrrrrrrar��extend)rr�rr.r
r
r�test_method_calls�s

*
4z#SpecSignatureTest.test_method_callscCs�Gdd�dt�}t|�}|jt|�g�|jtt|�|jtt|j�|jt|�g�|j|dt�|j|jdt�dS)Nc@seZdZiZdS)z=SpecSignatureTest.test_magic_methods.<locals>.BuiltinSubclassN)rrrr�r
r
r
rr�sr�r)	r�rrrprtrVr��assertIsInstancer)rr�rr
r
r�test_magic_methods�sz$SpecSignatureTest.test_magic_methodscCs�Gdd�dt�}xk||�fD]Z}t|dd�}|j|�|jtt|dd�|jtt|jdd�q&WdS)Nc@seZdZe�ZdS)z,SpecSignatureTest.test_spec_set.<locals>.SubN)rrrrr�r
r
r
rr�sr�Zspec_setTrr()rrrurprq�setattrr�)rr��specrr
r
r�
test_spec_set
s
zSpecSignatureTest.test_spec_setcCs�Gdd�dt�}Gdd�d|�}Gdd�dt|�}x{||�||�||�fD]X}t|�}|jdd�|jjdd�|jd	d
�|jjd	d
�qgWdS)Nc@s4eZdZedd��Zedd��ZdS)z/SpecSignatureTest.test_descriptors.<locals>.FoocSsdS)Nr
)�clsrrr
r
rrwsz1SpecSignatureTest.test_descriptors.<locals>.Foo.fcSsdS)Nr
)rrr
r
r�gsz1SpecSignatureTest.test_descriptors.<locals>.Foo.gN)rrr�classmethodrw�staticmethodr�r
r
r
rr'sr'c@seZdZdS)z/SpecSignatureTest.test_descriptors.<locals>.BarN)rrrr
r
r
r�Bar"sr�c@seZdZdS)z/SpecSignatureTest.test_descriptors.<locals>.BazN)rrrr
r
r
r�Baz%sr�r3r4r5r6)rrrrw�assert_called_once_withr�)rr'r�r�r�rr
r
r�test_descriptorss(z"SpecSignatureTest.test_descriptorsz No old style classes in Python 3cs�Gdd�d��G�fdd�d��}x~���||�fD]d}t|�}|jdd�|jjdd�|jtt|d�|jtt|jd�qHW|jjdd�|jjjdd�|jtt|jd�dS)Nc@seZdZdd�ZdS)z5SpecSignatureTest.test_old_style_classes.<locals>.FoocSsdS)Nr
)rrrr
r
rrw4sz7SpecSignatureTest.test_old_style_classes.<locals>.Foo.fN)rrrrwr
r
r
rr'3sr'cseZdZ��ZdS)z5SpecSignatureTest.test_old_style_classes.<locals>.BarN)rrrr�r
)r'r
rr�7sr�r3r4r)rrwr�rprqrrr�)rr�r�rr
)r'r�test_old_style_classes1sz(SpecSignatureTest.test_old_style_classescCs�Gdd�dt�}||_t|�}|�|j|jj�|j�|jj�|j|jtj�tjj�g�|j	|j
|j�|j|j
|j�|j
j
�|jt|jj
j�dS)Nc@s(eZdZdd�ZdZeZdS)z+SpecSignatureTest.test_recursive.<locals>.AcSsdS)Nr
)rr
r
rrIsz-SpecSignatureTest.test_recursive.<locals>.A.azfoo bar bazN)rrrrrr(r
r
r
r�AHsr�)r�BrrSZcalledrrrarZassertIsrr(�assertIsNot�lowerrprsr)rr�rr
r
r�test_recursiveGs	

(
z SpecSignatureTest.test_recursivecCs�Gdd�dt�}t|�}|j||��xy||�fD]h}|jdd�|jjdd�|jjd�|jt|jdd�|jtt|d�qEWt|��}|jd�|jjd�|jjdd�|jt|jdd�|jtt|d�|jt|�|j	j
d�|j	j
jd�|j	j
jd	d�|jtt|j	d
�|j	�j
d�|j	�j
jd�|j	�j
jd	d�|jtt|j	�d
�dS)Nc@s2eZdZdd�ZGdd�de�ZdS)z@SpecSignatureTest.test_spec_inheritance_for_classes.<locals>.FoocSsdS)Nr
)r�xr
r
rr`szBSpecSignatureTest.test_spec_inheritance_for_classes.<locals>.Foo.ac@seZdZdd�ZdS)zDSpecSignatureTest.test_spec_inheritance_for_classes.<locals>.Foo.BarcSsdS)Nr
)r�yr
r
rrwcszFSpecSignatureTest.test_spec_inheritance_for_classes.<locals>.Foo.Bar.fN)rrrrwr
r
r
rr�bsr�N)rrrrrr�r
r
r
rr'_sr'r�rhrr(rr]r�r�)rrr�rrrprtrqrrr�rw)rr'Z
class_mockZ	this_mockZ
instance_mockr
r
r�!test_spec_inheritance_for_classes^s0
z3SpecSignatureTest.test_spec_inheritance_for_classescCs�Gdd�dt�}||_t|�}|�}|jtt|d�|j�}|jtt|d�t|��}|jtt|d�|jt|�|j�}|jtt|d�dS)Nc@seZdZdZdS)z+SpecSignatureTest.test_inherit.<locals>.Foor5N)rrrrr
r
r
rr'�sr'r)rr'rrprqrrrt)rr'rr~Z
attr_instanceZcall_resultr
r
r�test_inherit�s		zSpecSignatureTest.test_inheritcCs�td�tt�td�tt�ti�tt�tg�tt�tt��tt�td�tt�td�tt�td�td�dS)Nr3rg�?y�?FT)rrVr rLr��set�float�complex)rr
r
r�
test_builtins�s 














zSpecSignatureTest.test_builtinscCs�dd�}t|�}|jt|�|dd�|jdd�|jddd�|jdddd�||_t|�}|jt|j�|jdd�|jjdd�|jjdddd�dS)	NcSsdS)Nr
)rrr
r
rrw�sz*SpecSignatureTest.test_function.<locals>.fr3r4rrr5r6)rrprtrrw)rrwrr
r
r�
test_function�s
	zSpecSignatureTest.test_functioncs�Gdd�dt��G�fdd�dt�}t|��|jt�fdd���jdd�|jt�fd	d���j}|j|jfdS)
Nc@seZdZddd�ZdS)z;SpecSignatureTest.test_skip_attributeerrors.<locals>.RaiserNcSs|dkrtd��dS)Nz$Can only be accessed via an instance)rq)rr��typer
r
r�__get__�szCSpecSignatureTest.test_skip_attributeerrors.<locals>.Raiser.__get__)rrrr�r
r
r
r�Raiser�sr�cs+eZdZ��Zedd��ZdS)z@SpecSignatureTest.test_skip_attributeerrors.<locals>.RaiserClasscSs||S)Nr
)rrr
r
r�existing�szISpecSignatureTest.test_skip_attributeerrors.<locals>.RaiserClass.existingN)rrr�raiserr�r�r
)r�r
r�RaiserClass�s	r�cs�jddd�S)Nr3r4r5)r�)r�)�sr
r�<lambda>�sz=SpecSignatureTest.test_skip_attributeerrors.<locals>.<lambda>r3r4cs�jS)N)Znonexistingr
)r�r
rr��s)	rrrprtr�rqr�rr()rr�r�r
)r�r�r�test_skip_attributeerrors�s	z+SpecSignatureTest.test_skip_attributeerrorscCsjGdd�dt�}t|�}|jt|�|d�|jd�|dd�|jdd�dS)Nc@seZdZddd�ZdS)z3SpecSignatureTest.test_signature_class.<locals>.Foor5cSsdS)Nr
)rrrr
r
r�__init__�sz<SpecSignatureTest.test_signature_class.<locals>.Foo.__init__N)rrrr�r
r
r
rr'�sr'r3r6rh)rrrprtr�r)rr'rr
r
r�test_signature_class�s


z&SpecSignatureTest.test_signature_classz no old style classes in Python 3cCs�Gdd�d�}t|�}|jt|�|d�|jd�|jdd�|jt|jd�|dd�|jdd�|jdddd�|jt|jdddd�dS)	Nc@seZdZddd�ZdS)z=SpecSignatureTest.test_signature_old_style_class.<locals>.Foor5cSsdS)Nr
)rrrr
r
rr��szFSpecSignatureTest.test_signature_old_style_class.<locals>.Foo.__init__N)rrrr�r
r
r
rr'�sr'r3rr4r6rhr)rrprtr�rsr)rr'rr
r
r�test_signature_old_style_class�s


z0SpecSignatureTest.test_signature_old_style_classcCs$Gdd�dt�}t|�dS)Nc@seZdZdS)z6SpecSignatureTest.test_class_with_no_init.<locals>.FooN)rrrr
r
r
rr'sr')rr)rr'r
r
r�test_class_with_no_initsz)SpecSignatureTest.test_class_with_no_initcCs!Gdd�d�}t|�dS)Nc@seZdZdS)z@SpecSignatureTest.test_old_style_class_with_no_init.<locals>.FooN)rrrr
r
r
rr'sr')r)rr'r
r
r�!test_old_style_class_with_no_initsz3SpecSignatureTest.test_old_style_class_with_no_initcCs5Gdd�dt�}t|�}|dd�|jdd�|jdddd�|jt|d�|dd�}|jt|�|dd�|jd�|jdd�|d�|jd�|jdd�t|dd��}|dd�|jdd�|jt|�|d�|jd�dS)Nc@s(eZdZdd�Zdd�ZdS)z;SpecSignatureTest.test_signature_callable.<locals>.CallablecSsdS)Nr
)rr�r�r
r
rr�szDSpecSignatureTest.test_signature_callable.<locals>.Callable.__init__cSsdS)Nr
)rrr
r
r�__call__szDSpecSignatureTest.test_signature_callable.<locals>.Callable.__call__N)rrrr�r�r
r
r
r�Callablesr�r3r4r�r�r)rrr�rprtr)rr�rr~r
r
r�test_signature_callables(






z)SpecSignatureTest.test_signature_callablecCs�Gdd�dt�}t|�}|�}|j�|jt|d�|jt|�|jt|d�t|��}|jt|�|jt|d�dS)Nc@seZdZdd�ZdS)zASpecSignatureTest.test_signature_noncallable.<locals>.NonCallablecSsdS)Nr
)rr
r
rr�1szJSpecSignatureTest.test_signature_noncallable.<locals>.NonCallable.__init__N)rrrr�r
r
r
r�NonCallable0sr�r)rrr�rprt)rr�rr~r
r
r�test_signature_noncallable/s	
z,SpecSignatureTest.test_signature_noncallablecCs\Gdd�dt�}t|�}|j}|j|td��|j�|jj�dS)Nc@seZdZdZdS)z8SpecSignatureTest.test_create_autospec_none.<locals>.FooN)rrrr(r
r
r
rr'Asr')rrr(�assertNotIsInstancer�rr�)rr'rZnoner
r
r�test_create_autospec_none@s	
z+SpecSignatureTest.test_create_autospec_nonecCs�Gdd�dt�}t|�}|jd�|jjd�|jjdd�|jdd�|jjd�|jjdd�dS)Nc@seZdZdd�ZdS)zMSpecSignatureTest.test_autospec_functions_with_self_in_odd_place.<locals>.FoocSsdS)Nr
)rrr
r
rrwNszOSpecSignatureTest.test_autospec_functions_with_self_in_odd_place.<locals>.Foo.fN)rrrrwr
r
r
rr'Msr'�
r)rrrwr)rr'rr
r
r�.test_autospec_functions_with_self_in_odd_placeLs
z@SpecSignatureTest.test_autospec_functions_with_self_in_odd_placecCs�Gdd�dt�}t|�}|j}|j|t�|ddd�|jddd�|jddd�|jjddd�dS)	Nc@s"eZdZedd��ZdS)z5SpecSignatureTest.test_autospec_property.<locals>.FoocSsdS)Nr5r
)rr
r
rr\sz9SpecSignatureTest.test_autospec_property.<locals>.Foo.fooN)rrr�propertyrr
r
r
rr'[sr'r3r4r5r6rhr])rrrr�r�abcr�)rr'rZ
mock_propertyr
r
r�test_autospec_propertyZs	z(SpecSignatureTest.test_autospec_propertycCs{Gdd�dt�}t|�}|j}|ddd�|jddd�|jddd�|jjddd�dS)	Nc@seZdZdgZdS)z2SpecSignatureTest.test_autospec_slots.<locals>.FoorN)rrr�	__slots__r
r
r
rr'lsr'r3r4r5r6rhr])rrrr�r�)rr'rZ	mock_slotr
r
r�test_autospec_slotsks	z%SpecSignatureTest.test_autospec_slotsN)*rrrrurvrxryr|�unittestZexpectedFailurerr�Z
skipUnless�six�PY3r�r�r�r�r�r�r�r�r��skipIfr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
rro<sB
!
!(!!	roc@saeZdZdd�Zdd�Zejejd�dd��Z	dd	�Z
d
d�ZdS)
�TestCallListcCs�t�}|j|jt�|dd�|dd�|dd�|dd�xQtdd�tdd�tdd�tdd�fD]}|j||j�q�Wtdd�tdd�g}|j||j�tdd�tdd�g}|j||j�tdd�tdd�g}|j||j�tdd�g}|j||j�|jtd�|j�|jtd�g|j�dS)	Nr3r4rr5r6rr]r`)rr�r^r
rrOZassertNotIn)rrrAZcallsr
r
r�!test_args_list_contains_call_list{s$	



=z.TestCallList.test_args_list_contains_call_listcCset�}|dd�|jdd�|jj�jddd�d}|jt|j�|�dS)	Nr3r4rr5r`�catZdogzU[call(1, 2),
 call.foo(a=3),
 call.foo.bar(),
 call.foo.bar().baz('fish', cat='dog')])rrr(r2rr r,)rrr.r
r
r�test_call_list_str�s	
zTestCallList.test_call_list_strz)Unicode is properly handled with Python 3cCsUt�}Gdd�dt�}|td�|�i�|jt|j�d�dS)Nc@seZdZdd�ZdS)z9TestCallList.test_call_list_unicode.<locals>.NonAsciiReprcSsdS)N�ér
)rr
r
r�__repr__�szBTestCallList.test_call_list_unicode.<locals>.NonAsciiRepr.__repr__N)rrrr�r
r
r
r�NonAsciiRepr�sr�ru[call(a=é)])rr�unicoderr r,)rrr�r
r
r�test_call_list_unicode�s	z#TestCallList.test_call_list_unicodecCs�tdtdt�}|j�}ztj|j�t�}|j|j�|j|j	t
�t
�g�d|_|j|j	t
�t
�t
d�g�Wd|j�XdS)Nz%s.SomeClass.oneZnew_callabler5)rrrrzrrr�rrr,r�stop)rr{rr�r
r
r�test_propertymock�s
	
	,zTestCallList.test_propertymockcCsXt�}t�}|t|�_|j}|j�|j|t�|j|t�dS)N)rrr�rr�r�r�)rrkr{Zreturnedr
r
r�test_propertymock_returnvalue�s			
z*TestCallList.test_propertymock_returnvalueN)rrrr�r�r�r�r�r�r�r�r�r
r
r
rr�ys
!r��__main__)r�Z	unittest2r�rrrrrrrrZ	mock.mockr	r
rrrZTestCaserr0ror�r�mainr
r
r
r�<module>s4
3���?U

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