o
    ¯bA  ã                   @   sH   d Z ddlmZmZmZ ddlmZ G dd„ deƒZG dd„ deƒZdS )	zJ
Tests for the insults windowing module, L{twisted.conch.insults.window}.
é    )ÚScrolledAreaÚ
TextOutputÚ	TopWindow)ÚTestCasec                   @   ó   e Zd ZdZdd„ ZdS )ÚTopWindowTestszB
    Tests for L{TopWindow}, the root window container class.
    c                    sÎ   g ‰ g }t ‡ fdd„|jƒ}|  ˆ g ¡ |  |g ¡ | ¡  |  ˆ g ¡ |  t|ƒd¡ | ¡  |  ˆ g ¡ |  t|ƒd¡ | ¡ ƒ  |  tˆ ƒd¡ |  |g ¡ | ¡  |  tˆ ƒd¡ |  t|ƒd¡ dS )z”
        Verify that L{TopWindow.repaint} schedules an actual paint to occur
        using the scheduling object passed to its initializer.
        c                      s
   ˆ   d ¡S )N)Úappend© ©Úpaintsr	   ú@/usr/lib/python3/dist-packages/twisted/conch/test/test_window.pyÚ<lambda>   s   
 z5TopWindowTests.test_paintScheduling.<locals>.<lambda>é   N)r   r   ÚassertEqualÚrepaintÚlenÚpop)ÚselfÚ	scheduledÚrootr	   r
   r   Útest_paintScheduling   s"   
z#TopWindowTests.test_paintSchedulingN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r	   r	   r   r   	   s    r   c                   @   r   )ÚScrolledAreaTestsz—
    Tests for L{ScrolledArea}, a widget which creates a viewport containing
    another widget and can reposition that viewport using scrollbars.
    c                 C   s2   t ƒ }t|ƒ}|  |j|j¡ |  |jj|¡ dS )zÌ
        The parent of the widget passed to L{ScrolledArea} is set to a new
        L{Viewport} created by the L{ScrolledArea} which itself has the
        L{ScrolledArea} instance as its parent.
        N)r   r   ÚassertIsÚparentÚ	_viewport)r   ÚwidgetÚscrolledr	   r	   r   Útest_parent8   s   zScrolledAreaTests.test_parentN)r   r   r   r   r!   r	   r	   r	   r   r   2   s    r   N)	r   Útwisted.conch.insults.windowr   r   r   Útwisted.trial.unittestr   r   r   r	   r	   r	   r   Ú<module>   s
    )