관리-도구
편집 파일: test_squeezer.cpython-36.pyc
3 � feU � @ s� d dl mZ d dlmZmZ d dlZd dlmZmZm Z m Z mZ d dlm Z d dlmZ d dlmZmZmZ d dlmZ d d lmZ d d lmZ d dlmZ e jZdd � ZG dd� dej�ZG dd� dej�Z G dd� dej�Z!e"dkr�ej#dd� dS )� )� namedtuple)�Text�TkN)�Mock�NonCallableMagicMock�patch�sentinel�ANY)�requires)�idleConf)�count_lines_with_wrapping�ExpandingButton�Squeezer)�macosx)� view_text)�Hovertip)�PyShellc s0 t d� t� � � j� � fdd�}| j|� � S )z*Helper for tests: Create a root Tk object.Zguic s � j � � j� d S )N)Zupdate_idletasksZdestroy� )�rootr �D/opt/alt/python36/lib64/python3.6/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 @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )�CountLinesTestz1Tests for the count_lines_with_wrapping function.c C s | j |t|||��S )N)�assertEqualr )�self�expected�text� linewidth�tabwidthr r r �check# s zCountLinesTest.checkc C s | j 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 | j 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 | j 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_line1 s z.CountLinesTest.test_count_ends_with_empty_linec C s | j td�d� dS )z Test with several lines of text.z1 2 3 � N)r r )r r r r �test_count_several_lines5 s z'CountLinesTest.test_count_several_linesc C s | j ddddd� | j ddddd� | j ddddd� | j ddddd� | j ddddd� | j ddd dd� | j d dd dd� | j ddd dd� | j ddddd� | j ddddd� | j ddddd� | j ddd dd� | j ddddd� | j ddddd� dS )z-Test with various tab widths and line widths.r% � � � )r r r r r# r'