Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/test_outwin.cpython-37.opt-2.pyc
B

YI~d��@s�ddlmZddlZddlmZddlmZmZddlm	Z	ddl
mZddlmZGdd	�d	ej
�ZGd
d�dej
�Zedkr�ejd
d�dS)�)�outwinN)�requires)�Tk�Text)�	Mbox_func)�Func)�mockc@s\eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�OutputWindowTestcCsFtd�t�}|_|��t�ddd|�}|_t|�|_|_dS)NZgui)	rr�rootZwithdrawrZOutputWindow�windowr�text)�clsr
�w�r�B/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_outwin.py�
setUpClasss
zOutputWindowTest.setUpClasscCs$|j��|`|`|j��|`dS)N)r�closerr
Zdestroy)r
rrr�
tearDownClasss

zOutputWindowTest.tearDownClasscCs|j�dd�dS)Nz1.0�end)r�delete)�selfrrr�setUpszOutputWindowTest.setUpcCs*|j}|�|�d��|�|�t��dS)Nztest.txt)rZassertFalseZispythonsource�__file__)rrrrr�test_ispythonsource sz$OutputWindowTest.test_ispythonsourcecCs|�|jj��d�dS)NZOutput)�assertEqualr�top�title)rrrr�test_window_title&sz"OutputWindowTest.test_window_titlecCsd|j}|j}t�|_d|j_||��d�||jjd�d|j_||��d�||jjd�|`dS)NF�no�TZyes�)rrrZ	get_saved�resultZ	maybesave�called)rr�eqrrr�test_maybesave)szOutputWindowTest.test_maybesavecCs�|j}|jj}|jj}|jj}d}|||�t|��||dd�|���|dd�d}|||�t|��||dd�d�||dd�d�|dd�d}|||�t|��||dd�d�||dd�d	�|dd�d
}|||�t|��||dd�d�||dd�d
�||dd�d
�|dd�d}d}|||dd�t|��|||dd�t|��||dd�|�||dd�|�||dd�|�d��||dd�|�d��dS)NsTest bytes.z1.0z1.endrz	test textzinsert linestartzinsert lineendz
test text
�ztest text
Line 2z2.0z2.endzLine 2zLine 2
Zmytag)ZtagsZ	secondtagzmytag.firstz
mytag.lastzsecondtag.firstzsecondtag.last�
)	rrr�getr�write�len�decode�rstrip)rr#rr'r(�bZ	test_textZ
test_text2rrr�
test_write7s@



zOutputWindowTest.test_writecCsb|j}|jj}|jj}|d�||dd�d�||dd�d�||dd	�d
�||dd�d
�dS)N)zLine 1
zLine 2
zLine 3
z1.0z1.endzLine 1z2.0z2.endzLine 2z3.0z3.endzLine 3zinsert linestartzinsert lineendr%)rrr'r�
writelines)rr#r'r.rrr�test_writelinescsz OutputWindowTest.test_writelinescCs
|j}|j}|j}t��|_t�}|j_t�}|_	|�
d�|�|���||j
d�||jd�|�
tt��d��|�
tt��d��|�|���||jtt�df�|�dd�|�
tt��d��|�
d�|�|���||jtt�d	f�|j`|`	dS)
NzNot a file linerzNo special linez: 42: spam
z
: 21: spam�z1.0r�*)rrrrZMock�flistrZgotofileliner�	showerrorr(ZassertIsNoneZgoto_file_liner"r�strr�argsr)rr#rrZgflr3rrr�test_goto_file_linens(


z$OutputWindowTest.test_goto_file_lineN)
�__name__�
__module__�__qualname__�classmethodrrrrrr$r-r/r6rrrrr	s,r	c@s2eZdZedd��Zdd�Ze�d�dd��ZdS)	�ModuleFunctionTestcCs
dt_dS)N)r�file_line_progs)r
rrrr�szModuleFunctionTest.setUpcCs6t��x(ttjtj�D]\}}|�|j|�qWdS)N)rZ
compile_progs�zipZfile_line_patsr<r�pattern)rZpatZregexrrr�test_compile_progs�sz%ModuleFunctionTest.test_compile_progsz
builtins.opencCsDtj}d}x4|D],\}}|�||�|�|r|�|dd�qWdS)N))z"foo file "testfile1", line 42, bar)Z	testfile1r1)zfoo testfile2(21) bar)Z	testfile2r0)z  testfile3  : 42: foo bar\n)z
  testfile3  r1)zfoo testfile4.py :1: )zfoo testfile4.py r)utestfile5: ᧔᧒: )Z	testfile5r1)z
testfile6: 42N)ztestfile7 42 textNr�r)rZfile_line_helperrZassert_called_with)rZ	mock_openZflhZ
test_lines�lineZexpected_outputrrr�test_file_line_helper�sz(ModuleFunctionTest.test_file_line_helperN)	r7r8r9r:rr?rZpatchrBrrrrr;�sr;�__main__r )�	verbosity)ZidlelibrZunittestZtest.supportrZtkinterrrZidlelib.idle_test.mock_tkrZidlelib.idle_test.mock_idlerrZTestCaser	r;r7�mainrrrr�<module>s

ZeroDay Forums Mini