관리-도구
편집 파일: test_squeezer.cpython-37.opt-1.pyc
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"