| Server IP : 66.29.146.62 / Your IP : 216.73.216.152 Web Server : LiteSpeed System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : dokkdzvi ( 925) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/ |
Upload File : |
B
� fxN � @ s� d Z ddlmZ ddlmZmZ ddlZddlmZm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZmZmZ dd lmZ dd
lmZ ddlmZ ddlmZ ejZd
d� ZG dd� dej�Z G dd� dej�Z!G dd� dej�Z"e#dkr�ej$dd� dS )zTest squeezer, coverage 95%� )�dedent)�Text�TkN)�Mock�NonCallableMagicMock�patch�sentinel�ANY)�requires)�idleConf)�count_lines_with_wrapping�ExpandingButton�Squeezer)�macosx)� view_text)�Hovertip)�PyShellc s0 t d� t� � � �� � fdd�}| �|� � S )z*Helper for tests: Create a root Tk object.Zguic s � � � � �� d S )N)Zupdate_idletasksZdestroy� )�rootr �D/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_squeezer.py�cleanup_root s z&get_test_tk_root.<locals>.cleanup_root)r
r Zwithdraw�
addCleanup)Z
test_instancer r )r r �get_test_tk_root s
r c @ sP e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� ZdS )�CountLinesTestz1Tests for the count_lines_with_wrapping function.c C s | � |t||��S )N)�assertEqualr )�self�expected�text� linewidthr r r �check% s zCountLinesTest.checkc C s | � td�d� dS )zTest with an empty string.� r N)r r )r r r r �test_count_empty+ s zCountLinesTest.test_count_emptyc C s | � td�d� dS )z/Test with a string which begins with a newline.z
text� N)r r )r r r r �!test_count_begins_with_empty_line/ s z0CountLinesTest.test_count_begins_with_empty_linec C s | � td�d� dS )z-Test with a string which ends with a newline.ztext
� N)r r )r r r r �test_count_ends_with_empty_line3 s z.CountLinesTest.test_count_ends_with_empty_linec C s | � td�d� dS )z Test with several lines of text.z1
2
3
� N)r r )r r r r �test_count_several_lines7 s z'CountLinesTest.test_count_several_linesc C s4 | j dddd� | j dddd� | j dddd� d S ) Nr$ �
�P )r r r r"