python (3.12.0)
͑e# d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z e j d Z G d d ej Z
ed
k( r ej yy)zCTest InteractiveConsole and InteractiveInterpreter from code module N)dedent) ExitStack)mock)
import_helpercodec N e Zd Zd Zd Zd Zd Zd Zd Zd Z d Z
d Zd
Zd Z
y)
TestInteractiveConsolec V t j | _ | j y )N)r InteractiveConsoleconsolemock_sysselfs I/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_code_module.pysetUpzTestInteractiveConsole.setUp s ..0
c t }| j |j |j t j
dd | _ |j t j
d | _ |j t j
d | _ t j
dt j t j }|j | | _ t j t j u r%| j j | j _ | j `| j `y) z.Mock system environment for InteractiveConsolez
code.inputT)createzcode.sys.stdoutzcode.sys.stderrzcode.sys)wrapsspecN)r
addCleanupclose
enter_contextr patchinfuncstdoutstderrr syssysmod
excepthook__excepthook__ps1ps2)r stackprepatchs r r
zTestInteractiveConsole.mock_sys s $))$**\15+7 8))$**5F*GH))$**5F*GH::jtxxH))(3>>S///%)[[%?%?DKK"KKOKKOr c Z t d | j _ | j j | j | j j d d| j _ | j j | j | j j d y )NFinishedz>>> z custom1> )EOFErrorr side_effectr interactassertEqualr r"