python (3.11.7)
    e/                         d dl Z d dlmZ d dlmZ d dlmZmZmZm	Z	m
Z
mZ e	j        Z
e	j        Z G d de          Z G d de j                  Z G d	 d
e j                  Zedk    r e j                     dS dS )    N)catch_warnings)is_instance)	MagicMockMockpatchsentinel	mock_opencallc                       e Zd ZdS )SampleExceptionN)__name__
__module____qualname__     S/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/unittest/test/testmock/testwith.pyr   r   
   s          r   r   c                   V    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Z
d Zd
S )WithTestc                    t          dt          z  t          j                  5  |                     t
          t          j        d           d d d            n# 1 swxY w Y   |                     t
          t          j                   d S N%s.something	unpatched)r   r
   r   
Something2assertEqual	something	Somethingselfs    r   test_with_statementzWithTest.test_with_statement   s    
>H,h.A
B
B 	J 	JY(;[III	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	JH$677777s   'AAAc                 z   |                      t                    5  t          dt          z  t          j                  5  |                     t          t          j        d           t                      # 1 swxY w Y   	 d d d            n# 1 swxY w Y   |                     t          t          j                   d S r   )	assertRaisesr   r   r
   r   r   r   r   r   r   s    r   test_with_statement_exceptionz&WithTest.test_with_statement_exception   s   
/
/ 	( 	(~0(2EFF 
( 
(  H,?MMM%'''
( 
( 
( 
( 
( 
( 
( 
( 
(	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	
H$677777s.   #B5A33A7	7B:A7	;BBBc                 8   t          dt          z            5 }|                     t          |d           |                     t          |t                    d           d d d            n# 1 swxY w Y   |                     t          t          j                   d S )Nr   r   zpatching wrong type)	r   r
   r   r   
assertTruer   r   r   r   r   mock_somethings     r   test_with_statement_aszWithTest.test_with_statement_as    s    
>H,
-
- 	3YDDDOOK	BB1
3 
3 
3	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	
H$677777s   AA**A.1A.c                     G d dt                     }|j        }t          j         |d          5  |                     |j        |d           d d d            n# 1 swxY w Y   |                     |j        |           d S )Nc                       e Zd ZdZdS )6WithTest.test_patch_object_with_statement.<locals>.FoofooN)r
   r   r   r   r   r   r   Foor*   )   s        IIIr   r,   r   r   )objectr   r   assertNotEqualr   )r   r,   originals      r    test_patch_object_with_statementz)WithTest.test_patch_object_with_statement(   s    	 	 	 	 	&