File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_squeezer.cpython-310.pyc
o
�i�L � @ s d Z ddlmZ ddlmZmZ ddlZddlmZm Z m
Z
mZmZ ddl
mZ ddlmZ ddlmZ dd lmZmZmZ dd
lmZ ddlmZ ddlmZ ejZd
d� ZG dd� dej�Z G dd� dej�Z!G dd� dej�Z"e#dkr~ej$dd� dS dS )zTest squeezer, coverage 95%� )�dedent)�Text�TkN)�Mock�NonCallableMagicMock�patch�sentinel�ANY)�requires)�idleConf)�
Percolator)�count_lines_with_wrapping�ExpandingButton�Squeezer)�macosx)� view_text)�Hovertipc s0 t d� t� � � �� � fdd�}| �|� � S )z*Helper for tests: Create a root Tk object.�guic s � � � � �� d S �N)Zupdate_idletasksZdestroy� ��rootr �</usr/local/lib/python3.10/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 r ��assertEqualr
)�self�expected�text� linewidthr r r �check$ s �zCountLinesTest.checkc C � | � td�d� dS )zTest with an empty string.� r Nr �r r r r �test_count_empty* � zCountLinesTest.test_count_emptyc C r$ )z/Test with a string which begins with a newline.z
text� Nr r&