U
    
W[C  ã                   @   sH   d Z ddlmZ ddlmZmZ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}.
é    )ÚTestCase)Ú	TopWindowÚScrolledAreaÚ
TextOutputc                   @   s   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© ©Zpaintsr   ú@/usr/lib/python3/dist-packages/twisted/conch/test/test_window.pyÚ<lambda>   ó    z5TopWindowTests.test_paintScheduling.<locals>.<lambda>é   N)r   r   ZassertEqualZrepaintÚlenÚpop)ÚselfZ	scheduledÚrootr   r	   r
   Útest_paintScheduling   s"    
z#TopWindowTests.test_paintSchedulingN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   r      s   r   c                   @   s   e Zd ZdZdd„ ZdS )Ú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   ZassertIsÚparentZ	_viewport)r   ZwidgetZscrolledr   r   r
   Útest_parent:   s    zScrolledAreaTests.test_parentN)r   r   r   r   r   r   r   r   r
   r   5   s   r   N)	r   Ztwisted.trial.unittestr   Ztwisted.conch.insults.windowr   r   r   r   r   r   r   r   r
   Ú<module>   s   *