python (3.11.7)

(root)/
lib/
python3.11/
unittest/
test/
testmock/
__pycache__/
testsealable.cpython-311.opt-2.pyc

eddlZddlmZGddZGddejZedkrejdSdS)N)mockceZdZdZdZdS)SampleObjectcdSNselfs W/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/unittest/test/testmock/testsealable.pymethod_sample1zSampleObject.method_sample1cdSrrr	s rmethod_sample2zSampleObject.method_sample2	r
rN)__name__
__module____qualname__rrrrrrrs"""""""""rrceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdS)TestSealablecbtj}||jtj||tj||tjdSr)rMockassertIsInstancetesttest2r
ms  r,test_attributes_return_more_mocks_by_defaultz9TestSealable.test_attributes_return_more_mocks_by_defaultswIKKafdi000affhh	222affhhnn..	:::::rc@tj}tj||t5|jdddn#1swxYwY|t5|ddddS#1swxYwYdSrrrsealassertRaisesAttributeErrorrrs  r.test_new_attributes_cannot_be_accessed_on_sealz;TestSealable.test_new_attributes_cannot_be_accessed_on_seals
IKK	!


~
.
.		
FF															


~
.
.		
ACCC																		s$AAA;BBBctj}tj||t5d|_ddddS#1swxYwYdSNrrs  r)test_new_attributes_cannot_be_set_on_sealz6TestSealable.test_new_attributes_cannot_be_set_on_sealsIKK	!


~
.
.		AF																		sAAActj}d|j_tj|d|j_||jjddS)Nr&)rrrrr assertEqualrs  r+test_existing_attributes_can_be_set_on_sealz8TestSealable.test_existing_attributes_can_be_set_on_seal%sLIKK	!q)))))rctj}d|j_tj||t5d|j_ddddS#1swxYwYdSr%)rrrrr r!r"test3rs  r2test_new_attributes_cannot_be_set_on_child_of_sealz?TestSealable.test_new_attributes_cannot_be_set_on_child_of_seal-sIKK	!


~
.
.		AFL																		s
A((A,/A,ctj}d|j_tj|||ddSN)rrrreturn_valuer r*rs  r+test_existing_attributes_allowed_after_sealz8TestSealable.test_existing_attributes_allowed_after_seal5sHIKK	!1%%%%%rctjd}tj|||jddS)Nr&)
test_value)rrr r*r5rs  r.test_initialized_attributes_allowed_after_sealz;TestSealable.test_initialized_attributes_allowed_after_seal=s?I###	!q)))))rctj}tj||t5|ddddS#1swxYwYdSr)rrr r!r"rs  rtest_call_on_sealed_mock_failsz+TestSealable.test_call_on_sealed_mock_failsCsIKK	!


~
.
.		
ACCC																		sAA!Actjd}tj|||ddS)N)r2)rrr r*rs  r)test_call_on_defined_sealed_mock_succeedsz6TestSealable.test_call_on_defined_sealed_mock_succeedsJsCI1%%%	!a     rctj}d|j_tj|||jjd|t5|jj	dddn#1swxYwY|t5|jjddddS#1swxYwYdSN)
rrtest1rr-r r*r!r"test4rs  r&test_seals_recurse_on_added_attributesz3TestSealable.test_seals_recurse_on_added_attributesPsLIKK !

	!.222


~
.
.	"	"
GMMOO!!	"	"	"	"	"	"	"	"	"	"	"	"	"	"	"


~
.
.		
GMM																		s$B==CC"
C<<DDctj}d|jjd_d|jjdd_tj|||jjdjd||jjddjd|t5|jjdj	dddn#1swxYwY|t5|jjddj	ddddS#1swxYwYdS)Nr>ar)r:)
r	MagicMockr?rr-r r*r!r"r@rs  r#test_seals_recurse_on_magic_methodsz0TestSealable.test_seals_recurse_on_magic_methods\sN#$
c #$
ac 	!s+11555qs+11555


~
.
.	%	%
GM#$$	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%


~
.
.	%	%
GM!A#$$	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%s$
C..C25C2D::D>D>cFtjd}tjd|j_d|jj_tj|||jjjd|jjjd|jj_dS)N	root_mockname
not_sealedr>r&)rrr?rr-r r*r@rs  r,test_seals_dont_recurse_on_manual_attributesz9TestSealable.test_seals_dont_recurse_on_manual_attributesjsI;'''	|444

	!,a000	

rc^	tjt}d|_d|_tj|||jd||jd|t5|j	ddddS#1swxYwYdS)Nr&r1)
rrrattr_sample1attr_sample3r r*r!r"attr_sample2rs  r)test_integration_with_spec_att_definitionz6TestSealable.test_integration_with_spec_att_definitionus>Il##	!++++++


~
.
.		
NN																		s
B""B&)B&cX	tjt}d|j_tj|||d|t5|	ddddS#1swxYwYdSr%)
rrrrr2r r*r!r"rrs  r,test_integration_with_spec_method_definitionz9TestSealable.test_integration_with_spec_method_definitionsJIl##()%	!))++Q///


~
.
.		
																		s=BB#&B#c	tjt}|t5d|j_ddddS#1swxYwYdSr0)rrrr!r"method_sample3r2rs  r:test_integration_with_spec_method_definition_respects_speczGTestSealable.test_integration_with_spec_method_definition_respects_specs7Il##


~
.
.	.	.,-A)	.	.	.	.	.	.	.	.	.	.	.	.	.	.	.	.	.	.s
AAActj}tj||t5}|jdddn#1swxYwY|dt|jdS)NSECRETE_name)	rrr r!r"rWassertInstr	exceptionr
rcms   r(test_sealed_exception_has_attribute_namez5TestSealable.test_sealed_exception_has_attribute_namesIKK	!


~
.
.	"
NN															

nc",&7&788888sAAAcntjd}|jjjjtj||t5}|jjjjj	dddn#1swxYwY|
dt|jdS)N	mock_namerHz&mock_name.test1.test2.test3.test4.boom)
rrr?rr-r@r r!r"boomrXrYrZr[s   r"test_attribute_chain_is_maintainedz/TestSealable.test_attribute_chain_is_maintainedsI;'''	
!!	!


~
.
.	+"
GM%**	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+

>BL@Q@QRRRRRsBB	Bctj}|jjtj||t5}|jdddn#1swxYwY|	dt|jdS)Nz mock.test1().test2.test3().test4)rrr?rr-r@r r!r"rXrYrZr[s   rtest_call_chain_is_maintainedz*TestSealable.test_call_chain_is_maintainedsIKK			%%	!


~
.
.	,"
GGIIO!!##))+++	,	,	,	,	,	,	,	,	,	,	,	,	,	,	,

8#bl:K:KLLLLLs2>B<<CCc	Gdd}dD]}||5tj||}d|j_d|jj_tj|||j	tj
||jtj||jtj||jtj||jj
tj
||jjtj||dd|j_||d||jdd|jj_||jd|t 5|	dddn#1swxYwY|t"5d	|_dddn#1swxYwY|t"5|dddn#1swxYwYd
|j_||d
|t"5|jdddn#1swxYwY|t"5d	|_dddn#1swxYwY|t"5|dddn#1swxYwY|t 5|j
dddn#1swxYwY|t"5|jjdddn#1swxYwY|t"5d	|j_dddn#1swxYwY|t"5|jdddn#1swxYwYdddn#1swxYwYdS)Nc8eZdZdZdZdZGddZdS)1TestSealable.test_seal_with_autospec.<locals>.FoorcdSr%rr	s rbar1z6TestSealable.test_seal_with_autospec.<locals>.Foo.bar1qrcdS)Nr)rr	s rbar2z6TestSealable.test_seal_with_autospec.<locals>.Foo.bar2rirceZdZdZdZdS)5TestSealable.test_seal_with_autospec.<locals>.Foo.Bazr1cdSr=rr	s rbanz9TestSealable.test_seal_with_autospec.<locals>.Foo.Baz.bans1rN)rrrbazrorrrBazrms(rrqN)rrrfoorhrkrqrrrFoorfs_C















rrs)TF)spec_setrCbnew_anew_br&rk)subTestrcreate_autospecrhr2rqror rrrNonCallableMagicMockrDrkrpr*r!	TypeErrorr"barmissing_attrmissing_method)r
rsrtrrs    rtest_seal_with_autospecz$TestSealable.test_seal_with_autospecs
	
	
	
	
	
	
	
	&-	--	-Hx00,
-,
-*3BBB(+%+.(	#%%cgt/HIII%%ch???%%ch???%%cgt~>>>%%cgk43LMMM%%cgk4>BBB  S111(/%  W555  444+2(  888&&y11GGIII&&~66  CG               &&~66HHJJJ)/%  V444&&~66%%$$%%%%%%%%%%%%%%%&&~66))'(C$)))))))))))))))&&~66))&&((()))))))))))))))&&y11""GKKMMM"""""""""""""""&&~66))G(()))))))))))))))&&~66--+,CG(---------------&&~66--G**,,,---------------W,
-,
-,
-,
-,
-,
-,
-,
-,
-,
-,
-,
-,
-,
-,
--	--	-s{HS/:IS/IS/"I#S/JS/JS/JS/9KS/KS/!K"AS/3M;S/MS/MS/,N4S/NS/NS/%O:S/O

S/
O
S/+PS/PS/PS/6
QS/QS/QS/4
R
S/
RS/RS/2SS/SS/S S//S3	6S3	N)rrrrr#r'r+r.r3r6r8r;rArErKrPrRrUr]rarcrrrrrrs7;;;***&&&***!!!


%%%	 	 	 			...999SSSMMM;-;-;-;-;-rr__main__)unittestrrTestCaserrmainrrr<module>rs########]-]-]-]-]-8$]-]-]-@zHMOOOOOr