← Back
Editing: test_listbox.cpython-38.pyc
U ��dZm � @ s� d dl Z d dlmZ d dlmZ d dlZG dd� de j�ZG dd� de j�ZG dd � d e j�Z G d d� de j�Z G dd � d e j�ZdS )� N��B)�SelectableTextc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�ListBoxCalculateVisibleTestc C s� t �|�}|j�|� ||_||_|jddd�\} } }| \}} }}}|d k rd|\}}||7 }||f}||ks~td|||f ��||ks�td|||f ��d S )N�� � � ��focus�%s got: %r expected: %r� %s (cursor) got: %r expected: %r)�urwid�ListBox�body� set_focus�offset_rows�inset_fraction�calculate_visible�AssertionError)�self�descr r r r �exp_offset_inset�exp_cur�lbox�middle�top�bottom�offset_inset�focus_widget� focus_pos�_ign�cursor�x�y� r% �:/usr/lib/python3/dist-packages/urwid/tests/test_listbox.py�cvtest s z"ListBoxCalculateVisibleTest.cvtestc C sz t j}|d�|d�|d�|d�|d�|d�|d�g}| �d|ddddd � | �d|dd dd d � | �d |ddddd � | �d|ddd dd � | �d|ddddd � | �d|ddddd � | �d|ddddd � | �d|ddddd � | �d|ddddd � | �d|dd ddd � | �d|ddd d d � | �d|d�|d�|d�gd ddd d � | �d|d�|d�|d�gd ddd d � d S )N� � � zsimple top position� r �r r zsimple middle positionr zsimple bottom position� zstraddle top edge)r r- ���zstraddle bottom edger zoff bottom edger zway off bottom edge�d z gap at topzgap at top and off bottom edgez gap at bottom� z%gap at bottom and straddling top edgez$gap at bottom cannot completely fillzgap at top and bottom)r �Textr'