| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j# � @ sx d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm Z e �
d�ZG dd � d ej�Z
ed
kr:e�� dS dS )zCTest InteractiveConsole and InteractiveInterpreter from code module� N)�dedent)� ExitStack)�mock)�
import_helper�codec @ sd e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dS )�TestInteractiveConsolec C s t �� | _| �� d S )N)r �InteractiveConsole�console�mock_sys��self� r
�,/usr/lib/python3.10/test/test_code_module.py�setUp s
zTestInteractiveConsole.setUpc C s� t � }| �|j� |�tjddd��| _|�t�d��| _|�t�d��| _tjdt j
t j
d�}|�|�| _t
jt
j
u rB| jj
| j_| j`| j`dS ) z.Mock system environment for InteractiveConsolez
code.inputT)�createzcode.sys.stdoutzcode.sys.stderrzcode.sys)�wraps�specN)r �
addCleanup�close�
enter_contextr �patch�infunc�stdout�stderrr �sys�sysmod�
excepthook�__excepthook__�ps1�ps2)r �stack�prepatchr
r
r r
s
�
zTestInteractiveConsole.mock_sysc C sL t d�| j_| j�� | �| jjd� d| j_| j�� | �| jjd� d S )N�Finishedz>>> z custom1> )�EOFErrorr �side_effectr �interact�assertEqualr r r r
r
r �test_ps1# �
zTestInteractiveConsole.test_ps1c C sL t d�| j_| j�� | �| jjd� d| j_| j�� | �| jjd� d S )Nr"