+
    Bi                         ^ RI t ^ RI Ht  ! R R4      t ! R R] P                  4      t]R8X  d   ] P                  ! 4        R# R# )    N)mockc                   ,   a  ] tR t^t o R tR tRtV tR# )SampleObjectc                    R # N selfs   &?/usr/lib/python3.14/test/test_unittest/testmock/testsealable.pymethod_sample1SampleObject.method_sample1       d    c                    R # r   r   r	   s   &r   method_sample2SampleObject.method_sample2	   r   r   r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     """r   r   c                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tRtV tR# )TestSealablec                X   \         P                  ! 4       pV P                  VP                  \         P                  4       V P                  VP                  4       \         P                  4       V P                  VP                  4       P	                  4       \         P                  4       R # r   )r   MockassertIsInstancetesttest2r
   ms   & r   ,test_attributes_return_more_mocks_by_default9TestSealable.test_attributes_return_more_mocks_by_default   s`    IIKaffdii0affh		2affhnn.		:r   c                h   \         P                  ! 4       p\         P                  ! V4       V P                  \        4      ;_uu_ 4        VP
                   R R R 4       V P                  \        4      ;_uu_ 4        V! 4        R R R 4       R #   + '       g   i     L?; i  + '       g   i     R # ; ir   r   r   sealassertRaisesAttributeErrorr    r"   s   & r   .test_new_attributes_cannot_be_accessed_on_seal;TestSealable.test_new_attributes_cannot_be_accessed_on_seal   sf    IIK		!~..FF /~..C /. /....s   	B;B B	 B1	c                    \         P                  ! 4       p\         P                  ! V4       V P                  \        4      ;_uu_ 4        ^Vn        RRR4       R#   + '       g   i     R# ; i   Nr'   r"   s   & r   )test_new_attributes_cannot_be_set_on_seal6TestSealable.test_new_attributes_cannot_be_set_on_seal   s?    IIK		!~..AF /...   	AA,	c                    \         P                  ! 4       p^VP                  n        \         P                  ! V4       ^VP                  n        V P                  VP                  P                  ^4       R# r.   )r   r   r    r!   r(   assertEqualr"   s   & r   +test_existing_attributes_can_be_set_on_seal8TestSealable.test_existing_attributes_can_be_set_on_seal%   sF    IIK		!q)r   c                   \         P                  ! 4       p^VP                  n        \         P                  ! V4       V P                  \        4      ;_uu_ 4        ^VP                  n        RRR4       R#   + '       g   i     R# ; ir.   )r   r   r    r!   r(   r)   r*   test3r"   s   & r   2test_new_attributes_cannot_be_set_on_child_of_seal?TestSealable.test_new_attributes_cannot_be_set_on_child_of_seal-   sN    IIK		!~..AFFL /...s   A66B	c                    \         P                  ! 4       p^VP                  n        \         P                  ! V4       V P                  VP                  4       ^4       R# )   N)r   r   r    return_valuer(   r4   r"   s   & r   +test_existing_attributes_allowed_after_seal8TestSealable.test_existing_attributes_allowed_after_seal5   s:    IIK		!1%r   c                    \         P                  ! ^R7      p\         P                  ! V4       V P                  VP                  ^4       R# )r/   )
test_valueN)r   r   r(   r4   rA   r"   s   & r   .test_initialized_attributes_allowed_after_seal;TestSealable.test_initialized_attributes_allowed_after_seal=   s/    II#		!q)r   c                    \         P                  ! 4       p\         P                  ! V4       V P                  \        4      ;_uu_ 4        V! 4        R R R 4       R #   + '       g   i     R # ; ir   )r   r   r(   r)   r*   r"   s   & r   test_call_on_sealed_mock_fails+TestSealable.test_call_on_sealed_mock_failsC   s=    IIK		!~..C /...r2   c                    \         P                  ! ^R7      p\         P                  ! V4       V P                  V! 4       ^4       R# )   )r=   N)r   r   r(   r4   r"   s   & r   )test_call_on_defined_sealed_mock_succeeds6TestSealable.test_call_on_defined_sealed_mock_succeedsJ   s-    II1%		!a r   c                \   \         P                  ! 4       p^VP                  P                  4       n        \         P
                  ! V4       V P                  VP                  P                  4       P                  ^4       V P                  \        4      ;_uu_ 4        VP                  P                  4       P                   RRR4       V P                  \        4      ;_uu_ 4        VP                  P                   RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)   N)
r   r   test1r!   r8   r(   r4   r)   r*   test4r"   s   & r   &test_seals_recurse_on_added_attributes3TestSealable.test_seals_recurse_on_added_attributesP   s    IIK !		!..2~..GGMMO!! /~..GGMM /. /....s   %D&DD	D+	c                B   \         P                  ! 4       p^VP                  P                  R,          n        ^VP                  P                  R,          n        \         P
                  ! V4       V P                  VP                  P                  R,          P                  ^4       V P                  VP                  P                  R,          P                  ^4       V P                  \        4      ;_uu_ 4        VP                  P                  R,          P                   RRR4       V P                  \        4      ;_uu_ 4        VP                  P                  R,          P                   RRR4       R#   + '       g   i     L_; i  + '       g   i     R# ; i)rL   a:   rH   NN)
r   	MagicMockrM   r!   r8   r(   r4   r)   r*   rN   r"   s   & r   #test_seals_recurse_on_magic_methods0TestSealable.test_seals_recurse_on_magic_methods\   s    NN#$c #$c 		!s+1115s+1115~..GGMM#$$ /~..GGMM#$$ /. /....s   ;(E:(F:F
	F	c                   \         P                  ! R R7      p\         P                  ! RR7      VP                  n        ^VP                  P                  n        \         P
                  ! V4       V P                  VP                  P                  P                  ^4       VP                  P                  P                   ^VP                  P                  n        R# )	root_mockname
not_sealedN)r   r   rM   r!   r8   r(   r4   rN   r"   s   & r   ,test_seals_dont_recurse_on_manual_attributes9TestSealable.test_seals_dont_recurse_on_manual_attributesj   s~    II;'		|4		!,,a0	r   c                ~   \         P                  ! \        4      p^Vn        ^Vn        \         P
                  ! V4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  \        4      ;_uu_ 4        VP                   RRR4       R#   + '       g   i     R# ; i)z0You are not restricted when using mock with specN)
r   r   r   attr_sample1attr_sample3r(   r4   r)   r*   attr_sample2r"   s   & r   )test_integration_with_spec_att_definition6TestSealable.test_integration_with_spec_att_definitionu   sx    IIl#		!++~..NN /...s   B++B<	c                \   \         P                  ! \        4      p^VP                  n        \         P
                  ! V4       V P                  VP                  4       ^4       V P                  \        4      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     R# ; i)z<You need to define the methods, even if they are in the specN)
r   r   r   r   r=   r(   r4   r)   r*   r   r"   s   & r   ,test_integration_with_spec_method_definition9TestSealable.test_integration_with_spec_method_definition   sn    IIl#()%		!))+Q/~.. /...s   ?BB+	c                    \         P                  ! \        4      pV P                  \        4      ;_uu_ 4        ^VP
                  n        RRR4       R#   + '       g   i     R# ; i)z)You cannot define methods out of the specN)r   r   r   r)   r*   method_sample3r=   r"   s   & r   :test_integration_with_spec_method_definition_respects_specGTestSealable.test_integration_with_spec_method_definition_respects_spec   s>    IIl#~..,-A) /...s   AA%	c                0   \         P                  ! 4       p\         P                  ! V4       V P                  \        4      ;_uu_ 4       pVP
                   R R R 4       V P                  R\        XP                  4      4       R #   + '       g   i     L7; i)NSECRETE_name)	r   r   r(   r)   r*   rl   assertInstr	exceptionr
   r#   cms   &  r   (test_sealed_exception_has_attribute_name5TestSealable.test_sealed_exception_has_attribute_name   sW    IIK		!~.."NN /nc",,&78 /.s   	BB	c                   \         P                  ! R R7      pVP                  P                  P                  P
                   \         P                  ! V4       V P                  \        4      ;_uu_ 4       pVP                  P                  P                  P
                  P                   RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)	mock_namerY   Nz&mock_name.test1.test2.test3.test4.boom)r   r   rM   r!   r8   rN   r(   r)   r*   boomrm   rn   ro   rp   s   &  r   "test_attribute_chain_is_maintained/TestSealable.test_attribute_chain_is_maintained   s    II;'	!!		!~.."GGMM%%** />BLL@QR /.s   55CC)	c                   \         P                  ! 4       pVP                  4       P                  P	                  4       P
                   \         P                  ! V4       V P                  \        4      ;_uu_ 4       pVP                  4       P                  P	                  4       P                  4        R R R 4       V P                  R\        XP                  4      4       R #   + '       g   i     L7; i)Nz mock.test1().test2.test3().test4)r   r   rM   r!   r8   rN   r(   r)   r*   rm   rn   ro   rp   s   &  r   test_call_chain_is_maintained*TestSealable.test_call_chain_is_maintained   s    IIK		%%		!~.."GGIOO!!#))+ /8#bll:KL /.s   ;7C!!C1	c           
         ! R  R4      pR	 EF  pV P                  VR7      ;_uu_ 4        \        P                  ! WR7      pRVP                  n        RVP
                  P                  n        \        P                  ! V4       V P                  VP                  \        P                  4       V P                  VP                  \        P                  4       V P                  VP                  \        P                  4       V P                  VP
                  \        P                  4       V P                  VP
                  P                  \        P                  4       V P                  VP
                  P                  \        P                  4       V P                  VP                  4       \        P                  4       V P                  VP                  4       R4       RVP                  n        V P                  VP                  4       R4       V P                  VP
                  P                  4       R4       RVP
                  P                  n        V P                  VP
                  P                  4       R4       V P                  \         4      ;_uu_ 4        VP                  4        RRR4       V P                  \"        4      ;_uu_ 4        ^Vn        RRR4       V P                  \"        4      ;_uu_ 4        VP                  4       P&                   RRR4       RVP                  n        V P                  VP                  4       R4       V P                  \"        4      ;_uu_ 4        VP(                   RRR4       V P                  \"        4      ;_uu_ 4        ^Vn        RRR4       V P                  \"        4      ;_uu_ 4        VP+                  4        RRR4       V P                  \         4      ;_uu_ 4        VP
                  P                  4        RRR4       V P                  \"        4      ;_uu_ 4        VP
                  P(                   RRR4       V P                  \"        4      ;_uu_ 4        ^VP
                  n        RRR4       V P                  \"        4      ;_uu_ 4        VP
                  P+                  4        RRR4       RRR4       EK  	  R#   + '       g   i     ELF; i  + '       g   i     EL-; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELw; i  + '       g   i     ELK; i  + '       g   i     EL#; i  + '       g   i     EL ; i  + '       g   i     L; i  + '       g   i     EK  ; i)
c                   D   a  ] tR t^t o ^ tR tR t ! R R4      tRtV t	R# )1TestSealable.test_seal_with_autospec.<locals>.Fooc                    R # r   r   r	   s   &r   bar16TestSealable.test_seal_with_autospec.<locals>.Foo.bar1       Dr   c                    R # r   r   r	   s   &r   bar26TestSealable.test_seal_with_autospec.<locals>.Foo.bar2   r   r   c                   *   a  ] tR t^t o ^tR tRtV tR# )5TestSealable.test_seal_with_autospec.<locals>.Foo.Bazc                    R # r   r   r	   s   &r   ban9TestSealable.test_seal_with_autospec.<locals>.Foo.Baz.ban   s    tr   r   N)r   r   r   r   bazr   r   r   r   s   @r   Bazr      s     ##r   r   r   N)
r   r   r   r   foor   r   r   r   r   r   s   @r   Foor~      s     C  $ $r   r   )spec_setrR   bnew_anew_bNr   )TF)subTestr   create_autospecr   r=   r   r   r(   r   r   NonCallableMagicMockrT   r   r   r4   r)   	TypeErrorr*   barxmissing_attrmissing_method)r
   r   r   r   s   &   r   test_seal_with_autospec$TestSealable.test_seal_with_autospec   s   	$ 	$ &Hx00**3B(+%+.(		#%%cggt/H/HI%%chh?%%chh?%%cggt~~>%%cggkk43L3LM%%cggkk4>>B %%chhj$..A  S1(/%  W5  4+2(  8&&y11GGI 2&&~66CG 7&&~66HHJLL 7 )/%  V4&&~66$$ 7&&~66'(C$ 7&&~66&&( 7&&y11GGKKM 2&&~66GG(( 7&&~66+,CGG( 7&&~66GG**, 7] 10 &2 211666666 76666666611166666666] 100s   I5V5 S.1%V5T%V5TAV54T*%V5&T>.%V5U$%V5	U&$%V5	U: %V5V%V5<V"V5.S?9	V5T	V5T'!	V5*T;5	V5>U		V5U#	V5&U71	V5:V	V5V	V5"V2-V55Wr   N)r   r   r   r   r$   r+   r0   r5   r9   r>   rB   rE   rI   rO   rU   r\   rb   re   ri   rr   rw   rz   r   r   r   r   s   @r   r   r      sk     ;*&*!
%	 	.9SM;- ;-r   r   __main__)unittestr   r   TestCaser   r   mainr   r   r   <module>r      sB     # #]-8$$ ]-@ zMMO r   