+
    Dfju                        R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt  ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      t ! R R]4      tR# )zJ
Tests for the insults windowing module, L{twisted.conch.insults.window}.
)annotations)Callable)ServerProtocol)ScrolledArea	Selection
TextOutput	TopWindowWidget)TestCasec                  &    ] tR t^tRtR R ltRtR# )TopWindowTestsz:
Tests for L{TopWindow}, the root window container class.
c                   V ^8  d   QhRR/#    returnNone )formats   "@/usr/lib/python3/dist-packages/twisted/conch/test/test_window.py__annotate__TopWindowTests.__annotate__   s     !, !,d !,    c                  a . o. p\        V3R lVP                  4      pV P                  S. 4       V P                  V. 4       VP                  4        V P                  S. 4       V P                  \	        V4      ^4       VP                  4        V P                  S. 4       V P                  \	        V4      ^4       VP                  4       ! 4        V P                  \	        S4      ^4       V P                  V. 4       VP                  4        V P                  \	        S4      ^4       V P                  \	        V4      ^4       R# )z|
Verify that L{TopWindow.repaint} schedules an actual paint to occur
using the scheduling object passed to its initializer.
c                 &   < S P                  R 4      # N)append)paintss   r   <lambda>5TopWindowTests.test_paintScheduling.<locals>.<lambda>   s    t!4r   N)r   r   assertEqualrepaintlenpop)self	scheduledrootr   s   &  @r   test_paintScheduling#TopWindowTests.test_paintScheduling   s   
  02	4i6F6FG 	$B' 	$Y+ 	$Y+ 	Va(B' 	Va(Y+r   r   N)__name__
__module____qualname____firstlineno____doc__r&   __static_attributes__r   r   r   r   r      s    !, !,r   r   c                  &    ] tR t^<tRtR R ltRtR# )ScrolledAreaTestsz
Tests for L{ScrolledArea}, a widget which creates a viewport containing
another widget and can reposition that viewport using scrollbars.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ScrolledAreaTests.__annotate__B   s     	; 	;T 	;r   c                    \        4       p\        V4      pV P                  VP                  VP                  4       V P                  VP                  P                  V4       R# )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scrolleds   &  r   test_parentScrolledAreaTests.test_parentB   sG     'fmmX%7%78h((//:r   r   N)r(   r)   r*   r+   r,   r8   r-   r   r   r   r/   r/   <   s    
	; 	;r   r/   c                  V    ] tR t^NtRtR R ltR R ltR R ltR R	 ltR
 R lt	Rt
R# )SelectionTestsz;
Change focused entry in L{Selection} using function keys.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   SelectionTests.__annotate__S   s     % %t %r   c                    \        ^
4       Uu. uF  q P                  R4      NK  	  pp\        VR4      V n        ^
V P                  n        ^V P                  n        R# u upi )zW
Create L{ScrolledArea} widget with 10 elements and position selection to 5th element.
asciiN)rangeencoder   r6   heightfocusedIndex)r#   _numseqs   &  r   setUpSelectionTests.setUpS   sU     CH)L)$f,,W5)LT*#$  Ms   Ac                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r=   \   s     3 3 3r   c                    V P                   P                  \        P                  R4       V P	                  V P                   P
                  ^4       R# )z?
Send DOWN_ARROW to select element just below the current one.
N)r6   keystrokeReceivedr   
DOWN_ARROWr3   rC   r#   s   &r   test_selectionDownArrow&SelectionTests.test_selectionDownArrow\   s6     	%%n&?&?Fdkk..2r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r=   c   s     3 3t 3r   c                    V P                   P                  \        P                  R4       V P	                  V P                   P
                  ^4       R# )z=
Send UP_ARROW to select element just above the current one.
N)r6   rJ   r   UP_ARROWr3   rC   rL   s   &r   test_selectionUpArrow$SelectionTests.test_selectionUpArrowc   s6     	%%n&=&=tDdkk..2r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r=   j        3 3D 3r   c                    V P                   P                  \        P                  R4       V P	                  V P                   P
                  ^	4       R# )zA
Send PGDN to select element one page down (here: last element).
N)r6   rJ   r   PGDNr3   rC   rL   s   &r   test_selectionPGDN!SelectionTests.test_selectionPGDNj   6     	%%n&9&94@dkk..2r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r=   q   rU   r   c                    V P                   P                  \        P                  R4       V P	                  V P                   P
                  ^ 4       R# )z@
Send PGUP to select element one page up (here: first element).
N)r6   rJ   r   PGUPr3   rC   rL   s   &r   test_selectionPGUP!SelectionTests.test_selectionPGUPq   rZ   r   )r6   N)r(   r)   r*   r+   r,   rF   rM   rR   rX   r^   r-   r   r   r   r;   r;   N   s%    %3333 3r   r;   c                  n    ] tR t^ytRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltRtR# )RecordingWidgetzb
A dummy Widget implementation to test handling of function keys by
recording keyReceived events.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   RecordingWidget.__annotate__   s     ' '$ 'r   c                	@    \         P                  ! V 4       . V n        R # r   )r	   __init__	triggeredrL   s   &r   re   RecordingWidget.__init__   s    $&r   c                    V ^8  d   QhRRRR/# r   modifierstrr   r   r   )r   s   "r   r   rc      s     $ $ $ $r   c                	<    V P                   P                  R 4       R# )F1Nrf   r   r#   rj   s   &&r   func_F1RecordingWidget.func_F1   s    d#r   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   rc           & &# &$ &r   c                	<    V P                   P                  R 4       R# )HOMENrn   ro   s   &&r   	func_HOMERecordingWidget.func_HOME       f%r   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   rc      s     , , , ,r   c                	<    V P                   P                  R 4       R# )rK   Nrn   ro   s   &&r   func_DOWN_ARROWRecordingWidget.func_DOWN_ARROW   s    l+r   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   rc      s     * *c *d *r   c                	<    V P                   P                  R 4       R# )rQ   Nrn   ro   s   &&r   func_UP_ARROWRecordingWidget.func_UP_ARROW   s    j)r   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   rc      rs   r   c                	<    V P                   P                  R 4       R# )rW   Nrn   ro   s   &&r   	func_PGDNRecordingWidget.func_PGDN   rx   r   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   rc      rs   r   c                	<    V P                   P                  R 4       R# )r]   Nrn   ro   s   &&r   	func_PGUPRecordingWidget.func_PGUP   rx   r   )rf   N)r(   r)   r*   r+   r,   re   rp   rv   r{   r   r   r   r-   r   r   r   ra   ra   y   s/    
'$&,*&& &r   ra   c                  &    ] tR t^tRtR R ltRtR# )WidgetFunctionKeyTestszF
Call functionKeyReceived with key values from insults.ServerProtocol
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   #WidgetFunctionKeyTests.__annotate__   s      $ r   c                   a a \        4       oR V V3R llpV! R4       V! R4       V! R4       V! R4       V! R4       V! R4       R	# )
zt
L{Widget.functionKeyReceived} dispatches its input, a constant on
ServerProtocol, to a matched C{func_KEY} method.
c                    V ^8  d   QhRRRR/# )r   keyrk   r   r   r   )r   s   "r   r   MWidgetFunctionKeyTests.test_functionKeyReceivedDispatch.<locals>.__annotate__   s     	% 	%S 	%T 	%r   c                   < SP                  \        \        V 4      R 4       SP                  V .SP                  4       SP                  P                  4        R # r   )functionKeyReceivedgetattrr   r   rf   clear)r   r#   r6   s   &r   checkOneKeyLWidgetFunctionKeyTests.test_functionKeyReceivedDispatch.<locals>.checkOneKey   sD    &&w~s'CTJcUF$4$45""$r   rm   ru   rK   rQ   rW   r]   N)ra   )r#   r   r6   s   f @r    test_functionKeyReceivedDispatch7WidgetFunctionKeyTests.test_functionKeyReceivedDispatch   sI    
 !"	% 	%
 	DFL!JFFr   r   N)r(   r)   r*   r+   r,   r   r-   r   r   r   r   r      s     r   r   N)r,   
__future__r   typingr   twisted.conch.insults.insultsr   twisted.conch.insults.windowr   r   r   r   r	   twisted.trial.unittestr
   r   r/   r;   ra   r   r   r   r   <module>r      sb    #  8  ,&,X &,R; ;$(3X (3V&f &:X r   