
    ;OOfp                         d dl Z d dlmZ d dlmZ d dlZ G d de j                        Z G d de j                        Z G d d	e j                        Z	 G d
 de j                        Z
 G d de j                        Zy)    N)B)SelectableTextc                       e Zd Zd Zd Zd Zy)ListBoxCalculateVisibleTestc                 T   t        j                  t        j                  |            }|j                  j	                  |       ||_        ||_        |j                  dd      \  }	}
}|	\  }}}}}||\  }}||z  }||f}||k(  sJ |d|d|       ||k(  sJ |d|d|       y )N         focus got:  expected:  (cursor) got: )urwidListBoxSimpleListWalkerbody	set_focusoffset_rowsinset_fractioncalculate_visible)selfdescr   r   r   r   exp_offset_insetexp_curlboxmiddletopbottomoffset_insetfocus_widget	focus_pos_igncursorxys                      Y/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/urwid/tests/test_listbox.pycvtestz"ListBoxCalculateVisibleTest.cvtest	   s     }}U33D9:		U$&,"44U4CV>D;lItVDAqATF//pTR^_o1pp/ [tFSZ"[[     c           	      4   t         j                  } |d       |d       |d       |d       |d       |d       |d      g}| j                  d|ddddd        | j                  d|dd	dd	d        | j                  d
|ddddd        | j                  d|ddddd        | j                  d|ddddd        | j                  d|ddddd        | j                  d|ddddd        | j                  d|ddddd        | j                  d|ddddd        | j                  d|dd	ddd        | j                  d|dddd	d        | j                  d |d       |d       |d      gd	ddd	d        | j                  d |d       |d       |d      gd	ddd	d        y )N 


zsimple top position   r   r   r   zsimple middle positionr   zsimple bottom position   zstraddle top edge)r   r1   zstraddle bottom edger	   zoff bottom edger
   zway off bottom edged   z
gap at topzgap at top and off bottom edgezgap at bottom   z%gap at bottom and straddling top edgez$gap at bottom cannot completely fillzgap at top and bottom)r   Textr)   r   Tls      r(   test1_simplez(ListBoxCalculateVisibleTest.test1_simple   s   JJrU1R5461T71R52?*q!UAt	& 	-q!UAt	& 	-q!UAt	& 	(q!UB	' 	+q!UAt	& 	&q!UAt	& 	*q#ua	( 	\q!UAt	& 	5q!UAt	& 	_q!UAt	& 	<q!UAt	& 	;rU1R52Aua	8 	,rU1R52Aua	8r*   c           	      "   t         j                  t         j                  }} |d       |d       |d       |dd       |d       |d       |d      g} |d       |d       |d       |dd       |d       |d       |d      g}|d   j                  d       | j	                  d|ddd	dd
       | j	                  d|ddd
dd       | j	                  d|ddddd       | j	                  d|ddd	dd       | j	                  d|ddd	dd       y )Nr,   r-   z

XzYY

r/   r1   zplain cursor in viewr   r0   r   r/   zcursor off topr   r1   r   zcursor further off topr1   r/   zcursor off bottomr   r	   zcursor way off bottomr3   )r   r5   Editset_edit_posr)   )r   r7   El1l2s        r(   test2_cursorz(ListBoxCalculateVisibleTest.test2_cursorI   s   zz5::1eAbE!D'!Bw-$"aeDeAbE!D'!Bx.42quE
11+1eQ	( 	%1eQ	) 	-1eQ	) 	(1eQ	) 	,3q&	+r*   N)__name__
__module____qualname__r)   r9   rD    r*   r(   r   r      s    \&*8Z+r*   r   c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)ListBoxChangeFocusTestc                    t        j                  t        j                  |            }|j                  d|||||       ||	f}|j                  |j
                  f}d }|j                  j                         \  }}|j                         rt        |d      r|j                  d      }||k(  sJ |d|d|       ||
k(  sJ |d|d|
       y )Nr   get_cursor_coords)r	   r   r   r   )r   r   r   change_focusr   r   r   	get_focus
selectablehasattrrL   )r   r   r   posr!   coming_fromr%   	snap_rowsexp_offset_rowsexp_inset_fractionr   r   expactr"   r#   s                   r(   cftestzListBoxChangeFocusTest.cftestb   s     }}U33D9:5#|[I	  11 3 33"&))"5"5"7i""$|$78#55d;czFtS#FFz [tFSZ"[[ r*   c                 >   t         j                  } |d       |d       |d       |d       |d      g}| j                  d|ddd d d ddd 
       | j                  d|ddd d d ddd 
       | j                  d	|dd
d d d ddd 
       | j                  d|ddd d d ddd 
       y )Nr-   r.   zsimple unselectabler1   r   r0   unselectabler   zunselectable off topr=   zunselectable off bottomr/   )r   r5   rX   r6   s      r(   test1unselectablez(ListBoxChangeFocusTest.test1unselectablex   s    JJtWQvYqy61T7;*q!T4q%	8 	^q!T4q%	8 	+q"dD$5$	9 	.q!T4q%	8r*   c                    t         j                  t        }} |d       |d       |d       |d       |d      g}| j                  d|ddd d d ddd 
       | j                  d|ddd d d ddd 
       | j                  d	|ddd
d d ddd 
       | j                  d|dddd d ddd 
       | j                  d|ddd
d d ddd 
       | j                  d|dddd d ddd 
       | j                  d|dddd d ddd 
       | j                  d|ddd
d d ddd 
       y )Nr-   r.   zsimple selectabler1   r   r0   rO   r   zselectable at topbelowzselectable at bottomabovezselectable off top snapr2   zselectable off bottom snapr/   zselectable off top no snapr;   zselectable off bottom no snapr   r5   r   rX   )r   r7   Sr8   s       r(   test2selectablez&ListBoxChangeFocusTest.test2selectable   sP   zz>1tWQvYqy61T7;(q!T4q%	8 	\q!T4q%	8 	(q!WdD!UD	; 	+q!WdD!UD	; 	.q"gtT1eT	< 	1q!WdD!UD	; 	1q"gtT1eT	< 	4q!WdD!UD	;r*   c                 `   t         j                  t        }} |d       |d       |d      g}| j                  d|ddd d d ddd 
       | j                  d|dd	d
d d ddd 
       | j                  d|dd	d
d dddd 
       | j                  d|dd	d
d dddd 
       | j                  d|dddd d ddd 
       | j                  d|dddd dddd 
       | j                  d|dddd dddd 
        |d       |d       |d      g}| j                  d|dddd d ddd 
       | j                  d|ddd
d d ddd 
       y )Nr-   z





zlarge selectable no snapr   r2   r   )r      zlarge selectable snap upr[   r^   r0   zlarge selectable snap up2r1   zlarge selectable almost snap up)r1   rd   zlarge selectable snap downr_   zlarge selectable snap down2z!large selectable almost snap down








z"large selectable outside view downr	   z large selectable outside view up)r   r4   r`   )r   r7   ra   r8   ms        r(   test3large_selectablez,ListBoxChangeFocusTest.test3large_selectable   s   zz>1tWQ~&qw//q"dD$5$	9 	/q"gtT1eT	< 	0q"gtQ5$	9 	6q"gtQ5$	9 	1q!WdD!UD	; 	2q!WdAq%	8 	8q!WdAq%	8 z]AlOQz];9q!WdD!UD	; 	7q"gtT1eT	<r*   c                 D    t         j                  t         j                  }}y N)r   r5   r?   r   r7   rA   s      r(   test4cursorz"ListBoxChangeFocusTest.test4cursor   s    jj%**!r*   c                     t         j                  t         j                  }}t        j                  t        j                   |d       |d      g            }|j                  d       y )Nr,   r   )r   r5   r?   r   SimpleFocusListWalkerset_focus_valign)r   r7   rA   r   s       r(   test5set_focus_valignz,ListBoxChangeFocusTest.test5set_focus_valign   sN    jj%**!}}U88bE1R5:  h'r*   N)	rE   rF   rG   rX   r\   rb   ri   rm   rq   rH   r*   r(   rJ   rJ   a   s!    \,8 ;8<>%(r*   rJ   c                   *    e Zd Zd Zd Zd Zd Zd Zy)ListBoxRenderTestc                 4   |D cg c]  }t        |       }}t        j                  t        j                  |            }|j                  j                  |       |j                  d|       |j                  dd      }	|	j                         D 
cg c]1  }
t               j                  |
D cg c]  \  }}}|
 c}}}      3 }}}}
}|	j                  }||k(  sJ |d|d|       ||k(  sJ |d|d|       y c c}w c c}}}w c c}}}}
w )Nr	   
   r   r   r   z (text) got: r   r   )r   r   r   r   r   r   shift_focusrendercontentbytesjoinr%   )r   r   r   r   offset_inset_rowsexp_textr   tr   canvaslnatcstextr%   s                  r(   ltestzListBoxRenderTest.ltest   s    "*+QAaD++}}U33D9:		U$!24e1.@F@PQQ"44IBAa45QQxWDh!WW [tFSZ"[[  , 5Qs   DD
4DD
D
c           
      N   t         j                  }| j                  d |d      gddg dd        | j                  d |d       |d       |d       |d	       |d
      gddg dd        | j                  d |d       |d       |d       |d	       |d
      gddg dd        y )Nzsimple one text item render1
2r   )1   2       r   r   z(simple multi text item render off bottom123
456r1   r   r   3   4   5   z%simple multi text item render off topr   r   r   r   r   6   r   r5   r   r   r7   s     r(   r9   zListBoxRenderTest.test1_simple   s    JJ

1vYKA0	7 	

>sVAcF1V9QsVAcF3Q0	7 	

;sVAcF1V9QsVAcF3Q0	7r*   c                    t         j                  }| j                  d |d       |d       |d      gddg dd        | j                  d |d       |d       |d      gddg d	d        | j                  d
 |d      gddg dd        | j                  d |d      gddg dd        | j                  d |d      gddg d	d        | j                  d |d      gddg d	d        y )Nztrim unfocused bottomr   r   5
6r   r1   r   ztrim unfocused topr   ztrim none full focusz	1
2
3
4
5r   ztrim focus bottomz1
2
3
4
5
6ztrim focus topr2   ztrim focus top and bottomz1
2
3
4
5
6
7r   r   s     r(   
test2_trimzListBoxRenderTest.test2_trim   s    JJ

+vYqy6+Q0	7 	

(vYqy6+Q0	7 	

* !Q0	7 	

'!"#Q0	7 	

$!"#Q0	7 	

/$%&20	7r*   c           
         t         j                  t         j                  }}| j                  d |d       |d       |d       |d       |d      gddg d	d         |d
dd      }|j	                  d       | j                  d| |d       |d       |d      gddg dd       | j                  d |d       |d       |d       |d
d      gddg dd       | j                  d |d
d       |d       |d       |d      gddg dd        |d
d      }|j	                  d       | j                  d |d       |d       |d      |gddg dd        y )!Nzshift up one fitr   34r   r   r	   r
   r   r,   zab
cr   r1   zshift down one cursor over edger   r   r2   )zab  zc   r   r   r   r<   zshift up one cursor over edgezd
er/   )r   r   r   zd   ze   r>   z%shift none cursor top focus over edgezab
)r   r   r   r   r   r   r   zabc
dz(shift none cursor bottom focus over edge)r   r   r   r   zabc r/   r	   )r   r5   r?   r   r@   )r   r7   rA   es       r(   test3_shiftzListBoxRenderTest.test3_shift	  sQ   jj%**!

&vYqvafQsVAcF3Q0	7 bO	

5qvafQvY'B0%	9 	

3vYqvafQr&\2Aq0%	9 	

;r&\!C&3&	2Ar0%	9 bN	

>vYqvafQ'A0%	9r*   c                     t         j                  t         j                  }}| j                  d |d      gddg dd        | j                  d |dd      gddg dd       y )Nzreally large edit  hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellor   )hellohellohellohellor,   )r   r   r   r   zllo r   )r   r5   r?   r   rl   s      r(   test4_really_large_contentsz-ListBoxRenderTest.test4_really_large_contents$  s\    jj%**!

&|_q!0$	8 	

&sL!"Aq0%	9r*   N)rE   rF   rG   r   r9   r   r   r   rH   r*   r(   rs   rs      s    \776969r*   rs   c                   .    e Zd Z	 ddZd Zd Zd Zd Zy)ListBoxKeypressTestNc
                    |	Ut        j                  t        j                  |            }	|	j                  j	                  |       |	j                  d|       |	j                  d|      }
|	j                  dd      \  }}}|\  }}}}}||\  }}||z  }||f}||f}||f}||k(  sJ |d|d|       ||k(  sJ |d|d|       |
|	fS )Nru   r   r   r   r   r   r   )r   r   r   r   r   rw   keypressr   )r   r   keyr   r   r!   	exp_focusr   r   r   ret_keyr   r   r    r"   r#   r$   r%   r&   r'   rV   rW   s                         r(   ktestzListBoxKeypressTest.ktest0  s     <==!7!7!=>DII(V\3--c*"44U4CV>D;lItVDAqATF))%czDtCDDz [tFSZ"[[ t|r*   c                    t         j                  t        t         j                  }}}| j	                  dd |d       |d      gddddd        | j	                  dd |d       |d       |d      gddddd        | j	                  dd |d      gddddd       \  }}|dk(  sJ | j	                  d	d |d       |d       |d      gddddd       \  }}|dk(  sJ | j	                  d
d |d       |d       |d      gddddd        | j	                  dd |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d      gddddd        | j	                  dd |dd       |dd      gddddd       | j	                  dd |dd       |d       |dd      gddddd       \  }}| j	                  ddd d d ddd|	       | j	                  dd |d       |dd      gdd ddd        | j	                  d!d |d       |dd      gdd ddd        | j	                  d"d |d       |d      gddddd        | j	                  d#d |d       |dd$      gddddd        | j	                  d%d |d       |d       |d       |d       |d       |d       |d      gddddd        | j	                  d&d |d       |d'       |d       |d       |d       |d      gddddd        | j	                  d(d |dd)       |dd$       |dd*      gddddd+      \  }}| j	                  d,dd d d ddd-|	        |dd      }|j                  d       | j	                  d.d|gddddd/      \  }}|j                  d   dk(  sJ y )0Ndirect selectable both visibleupr,   r   r   selectable skip one all visibler1   znothing above no scrollzunselectable above no scrollzunselectable above scroll 1


zselectable above scroll 1zselectable above too farz selectable above skip 1 scroll 1ztall selectable above scroll 2r-   z#very tall selectable above scroll 5re   "very tall selected scroll within 1rf   r2   zedit above pass cursorabcder<   z edit too far above pass cursor Ar	   z edit too far above pass cursor B$within focus cursor made not visiblehi
abr/   (within focus cursor made not visible (2)force focus unselectablepathological cursor widgetaunselectable to unselectableunselectable over edge to same12
34 edit short between pass cursor Aabcddefr   r    edit short between pass cursor B)r/   r   edit cursor force scrollr   )r   r5   r   r?   r   r@   r   )r   r7   ra   rA   r   r   r   s          r(   test1_upzListBoxKeypressTest.test1_upH  s   

NEJJA!

4drU1R5M1aq$	 	

5trU1R52Aq$	 ::8$rUGQq$D d{{JJ >rU1R52Aq$	T d{{

14rU1R58%q!q$	 	

/rU1R58%q!q$	 	

.rU1R52q{+Qq$	 	

6rU1R52q{+Qq$	 	

4drU1T71R58-q!q$	 	

94rU1Z=2q}5q!q$	 	

8$rU1\?#Qq$	 	

,dr%[2d$aq&	 ::A4r%[:qDz2Aqq$D 	

6$q%	  	

:Dx[6$(!Qq$	 	

>z]1VD>*Aqr4	 	

.z]1R5!1aq$	 	

0$tWQ|C()1ar4	 	

2DrU1R52quQrU1R527Aq$	 	

4drU1X;quQrU1R527"q$	 ::A4r&\!Bs)AbK0!Qq%D 	

6$q%	  b	q::94CBq%D ""1%***r*   c                    t         j                  t        t         j                  }}}| j	                  dd |d       |d      gddddd        | j	                  dd |d       |d       |d      gddddd        | j	                  dd |d      gddddd       \  }}|dk(  sJ | j	                  d	d |d       |d       |d      gddddd       \  }}|dk(  sJ | j	                  d
d |d       |d       |d      gddddd        | j	                  dd |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d      gddddd        | j	                  dd |d       |d      gddddd        | j	                  dd |dd       |dd      gddddd       | j	                  dd |dd       |d       |dd      gddddd       \  }}| j	                  ddd d d ddd|	        |dd      }|j                  d       d  |_        | j	                  d!d| |d      gddddd        | j	                  d"d| |d      gddddd        | j	                  d#d |d       |d      gddddd        |j                  d$       | j	                  d%d| |d      gddddd        | j	                  d&d |d       |d       |d       |d       |d       |d       |d      gddd'dd        | j	                  d(d |d       |d       |d       |d       |d)       |d      gddddd        | j	                  d*d |dd       |dd+       |dd,      gddddd-      \  }}| j	                  d.dd d d ddd/|	        |dd      }|j                  d       | j	                  d0d|gddddd1      \  }}|j                  d   dk(  sJ y )2Nr   downr,   r   r   r   r1   znothing below no scrollzunselectable below no scrollzunselectable below scroll 1r   r	   r/   zselectable below scroll 1zselectable below too farz selectable below skip 1 scroll 1ztall selectable below scroll 2r-   z#very tall selectable below scroll 5re   r   rf   r2   zedit below pass cursorr   r   r1   r   z edit too far below pass cursor Az edit too far below pass cursor B)r1   r	   hi
abc                      yNr   rH   scxys      r(   <lambda>z0ListBoxKeypressTest.test2_down.<locals>.<lambda>      r*   r   r   r   zhi




r   r   r
   r   r   r   r   defgr   r   )r/   r1   r   r   r	   )	r   r5   r   r?   r   r@   move_cursor_to_coordsset_edit_textr   )r   r7   ra   rA   r   r   odd_er   s           r(   
test2_downzListBoxKeypressTest.test2_down  s1   

NEJJA!

4frU1R5M1aq$	 	

5vrU1R52Aq$	 ::8&rUGQq$D f}}JJ >rU1R52Aq$	T f}}

16x[2qu%q!q$	 	

/x[2qu%q!q$	 	

.x[2quQrU+Qq$	 	

6x[2quQrU+Qq$	 	

4fx[2qwqu-q!q$	 	

96z]1R5:qu5q!q$	 	

8&|_QrU#Qr4	 	

,fr$Z"U$aq&	 ?r$Z*a5k2Aqq$D 	

6$q%	  "XA&6#

:F1Z=!1aq$	 	

>1Z="Aqq$	 	

.rU1Z=!1aq$	 	^-

0&1T7OQq$	 	

2FrU1R52quQrU1R527Aq$	 	

4frU1R52quQx[27!q$	 ?r%[2c1R<0!Qq%D 	

6$q%	  b	q::96CAr5D ""1%***r*   c                    t         j                  t        t         j                  }}}| j	                  dd |d       |d       |d       |d       |d       |d      gddddd        | j	                  d	d |d       |d       |d       |d       |d       |d      gdd
ddd        | j	                  dd |d       |d       |d       |d       |d       |d      gdddd
d        | j	                  dd |d       |d       |d       |d       |d      gdddd
d        | j	                  dd |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d      gdddd
d         |dd      }|j                  d       | j	                  dd |d      | |d      gddddd       | j	                  dd |d       |dd       |d      gddddd         |dd      }|j                  d       | j	                  dd |d      | |d      gddddd       | j	                  dd |d       |d       |d       |d       |d       |d      gd dddd        | j	                  d!d |d       |d       |d       |d       |d       |d      gd dddd        | j	                  d"d |d       |d       |d       |d       |d       |d       |d       |d      gd#d$ddd        | j	                  d%d |d       |d       |d       |d       |d       |d       |d       |d      gd#d$ddd        | j	                  d&d |d       |d       |d       |d       |d       |d       |d       |d      gd#d$d$dd        | j	                  d'd |d       |d       |dd(       |d       |d      gd$dd$dd)       | j	                  d*d |d       |d       |dd       |d       |d      gd$dddd         |dd+      }|j                  d$       d, |_        | j	                  d-d| |d       |d       |d       |d       |d      gdd$dd
d        | j	                  d.d |d       |d       |d       |d       |d       |d      gdd$d$dd        | j	                  d/d |d       |d       |d       |d       |d       |d      gdd$dd
d        | j	                  d0d |d       |d       |d      gddddd        | j	                  d1d |d2       |d      gddddd        | j	                  d3d |d       |d4      gddddd        | j	                  d5d |d       |d2       |d6       |d7      gddddd        | j	                  d8d |d6       |d9       |d9       |d7       |d:       |d9      gddddd        | j	                  d;d |d6       |d9       |d9       |d7       |d:       |d9      gddddd        y )<Nunselectable aligned to alignedpage upr,   r-   r.   r/   r   r   !unselectable unaligned to alignedr2   selectable to unselectabler	    selectable to cut off selectableseletable to selectablewithin very long selectable







iz

ab




cd
   within very long cursor widgetr[   r<   r   r   rg   
ab




cd
rv   very long cursor widget snapr   slight scroll selectabler   r
   scroll into snap regionmid scroll shortr4   r1   mid scroll longmid scroll perfectcursor move up fail shortz
abr   cursor force fail shortr   c                      yr   rH   r   s      r(   r   z3ListBoxKeypressTest.test3_page_up.<locals>.<lambda>_  r   r*   cursor force fail longprefer not cut offallow cut offzat top failall visible failr   current ok failhiz!all visible choose top selectablebr   zbring in edge choose top-dz#bring in edge choose top selectabler   r5   r   r?   r   r@   r   r   r7   ra   rA   r   r   s         r(   test3_page_upz!ListBoxKeypressTest.test3_page_up  s   

NEJJA!

5yrU1T71V9QrU1T71V9=q!q$	 	

7rU1T71T71T71T71V9=qq$	 	

0)rU1T71T71T71T71V9=q!r4	 	

6	vYqwqwqwqy91ar4	 	

-yvYqwqwqwqy91aq$	 	

19rU1'(411br4	 b'(	r

4irU1QtWq"r6	 	

0)rU1'-ae4aq$	 b%&	r

2IrU1QtWq"q&	 	

.	tWQtWQrU1R58QrU;Qq$	 	

-ytWQtWQrU1R58QrU;Qq$	 	

&	tWQrU1R52quQtWQrU1T7CqQ4	" 	

%ytWQrU1R52quQtWQrU1T7CqQ4	" 	

()tWQrU1R52quQtWQrU1T7CqQ4	" 	

/tWQtWQr&\!B%"61q&	 	

-ytWQtWQtD\!B%"61q$	 "XA&6#

,i1T71T71T71R5491ar4	 	

()tWQtWQrU1V9QrU1T7;Qq$	 	

OYtWQtWQrU1V9QrU1T7;Qr4	 	

M9vYqwq{+Qq$	 	

&	sVAdGaq$	 	

%yvYqwAq$	 	

7rU1S6!C&3(!Qq$	 	

.	sVAcF1S6!C&3#7!q$	 	

99sVAcF1S6!C&3#7!q$	r*   c                    t         j                  t        t         j                  }}}| j	                  dd |d       |d       |d       |d       |d       |d      gddddd        | j	                  d	d |d       |d       |d       |d       |d       |d      gddddd        | j	                  d
d |d       |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d      gddddd         |dd      }|j                  d       | j	                  dd |d      | |d      gddddd        |dd      }|j                  d       d |_        | j	                  dd |d      | |d      gddddd         |dd      }|j                  d       | j	                  dd |d      | |d      gddddd       | j	                  dd |d       |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d       |d       |d      gddddd        | j	                  dd |d       |d       |d       |d       |d       |d       |d       |d      gddddd        | j	                  d d |d       |d       |d       |d       |d       |d       |d       |d      gddd!dd        | j	                  d"d |d       |d       |d       |d       |d       |d       |d       |d      gddd#dd         |dd$      }|j                  d       | j	                  d%d |d       |d      | |d       |d      gdddd&d'        |dd$      }|j                  d       d( |_        | j	                  d)d |d       |d      | |d       |d      gddddd        | j	                  d*d |d       |d       |d       |d       |d       |d+d,      gddddd        | j	                  d-d |d       |d       |d       |d       |d       |d      gddddd        | j	                  d.d |d       |d       |d       |d       |d       |d      gddd#dd        | j	                  d/d |d       |d       |d      gddddd        | j	                  d0d |d1       |d      gddddd        | j	                  d2d |d3       |d      gddddd        | j	                  d4d |d1       |d5       |d6       |d      gddddd        | j	                  d7d |d8       |d9       |d6       |d8       |d8       |d5      gddd#dd        | j	                  d:d |d8       |d9       |d6       |d8       |d8       |d5      gddddd        y );Nr   	page downr.   r-   r,   r1   r	   r/   r   r   r   r   r   r   r   z
ab




cd

r   r[   r>   zab








c                      yr   rH   r   s      r(   r   z5ListBoxKeypressTest.test4_page_down.<locals>.<lambda>  r   r*   r   r   r   r;   r   r   r   r   r   r   r4   r   r
   r   r   r2   )r   r   c                      yr   rH   r   s      r(   r   z5ListBoxKeypressTest.test4_page_down.<locals>.<lambda>  r   r*   r   r   r   r   r   r   zat bottom failr   r   r   r   z"all visible choose last selectabler   r   zbring in edge choose lastr   r   z$bring in edge choose last selectabler   r   s         r(   test4_page_downz#ListBoxKeypressTest.test4_page_down  s   

NEJJA!

5{vYqwquQvYqwqu=q!q$	 	

7vYqwqwqwqwqu=q!q$	 	

0+vYqwqwqwqwqu=q!q$	 	

6vYqwqwqwqy91aq$	 	

-{vYqwqwqwqy91aq$	 	

1;tWQ)*1R511ar4	 b'(	q

4ktWQquq!r6	 "+,A&6#

0+rU52Aq$	 b%&	q

2KtWQquq!r6	 	

.rU1X;quQrU1T71T7;Qq$	 	

-{rU1X;quQrU1T71T7;Qq$	 	

&tWQrU1T71R52quQrU1T7CqQ4	" 	

%{tWQrU1T71R52quQrU1T7CqQ4	" 	

(+tWQrU1T71R52quQrU1T7CqQ4	" bN	

/rU1R51T71T7+Qr6	
 "XA&6#

-{rU1R5qwqw/Aq$	 	

,ktWQrU1T71T71T71VD>BqQ4	" 	

(+tWQrU1V9QrU1T71T7;Qq$	 	

O[tWQrU1V9QrU1T71T7;Qq$	 	

$kvYqwq{+Qq$	 	

&sVAdGaq$	 	

%{tWQvYAq$	 	

8+sVAcF1S6!B%(!Qq$	 	

/sVAcF1S6!C&3#7!a	 	

:KsVAcF1S6!C&3#7!a	r*   rk   )rE   rF   rG   r   r   r   r   r  rH   r*   r(   r   r   /  s%    590b+Hg+Rm^tr*   r   c                   *    e Zd Zd Zd Zd Zd Zd Zy)ZeroHeightContentsTestc                     t        j                  t        j                  t        j                  g       g            }|j	                  dd       y )N(   rv   Tr   )r   r   r   Pilerx   r   lbs     r(   test_listbox_pilez(ZeroHeightContentsTest.test_listbox_pile  s;    ]]511ZZ^ 
		'	&r*   c                 x   t        j                  t        j                  t        j                  d      t        j                  g       g            }|j                  dd       | j                  |j                         d   d       |j                  dd       | j                  |j                         d   d       y )Nr_   r  r   r   r   )r   r   r   r5   r  r   assertEqualrN   r	  s     r(    test_listbox_text_pile_page_downz7ZeroHeightContentsTest.test_listbox_text_pile_page_down  s    ]]511ZZ!5::b>24 5
G[)*A.
G[)*A.r*   c                    t        j                  t        j                  t        j                  g       t        j                  d      g            }|j                  d       |j                  dd       | j                  |j                         d   d       |j                  dd       | j                  |j                         d   d       y )Nr^   r   r  r   )	r   r   r   r  r5   r   r   r  rN   r	  s     r(   test_listbox_text_pile_page_upz5ZeroHeightContentsTest.test_listbox_text_pile_page_up	  s    ]]511ZZ^UZZ124 5
Q
GY'*A.
GY'*A.r*   c                    t        j                  g       }d |_        t        j                  t        j                  t        j
                  d      |g            }|j                  dd       | j                  |j                         d   d       |j                  dd       | j                  |j                         d   d       y )Nc                       yNTrH   rH   r*   r(   r   zDZeroHeightContentsTest.test_listbox_text_pile_down.<locals>.<lambda>  r   r*   r_   r  r   r   r   )	r   r  rO   r   r   r5   r   r  rN   r   spr
  s      r(   test_listbox_text_pile_downz2ZeroHeightContentsTest.test_listbox_text_pile_down  s    ZZ^$]]5115::h3G2LMN
GV$*A.
GV$*A.r*   c                    t        j                  g       }d |_        t        j                  t        j                  |t        j
                  d      g            }|j                  d       |j                  dd       | j                  |j                         d   d       |j                  dd       | j                  |j                         d   d       y )Nc                       yr  rH   rH   r*   r(   r   zBZeroHeightContentsTest.test_listbox_text_pile_up.<locals>.<lambda>  r   r*   r^   r   r  r   )
r   r  rO   r   r   r5   r   r   r  rN   r  s      r(   test_listbox_text_pile_upz0ZeroHeightContentsTest.test_listbox_text_pile_up  s    ZZ^$]]5112uzz(7K2LMN
Q
GT"*A.
GT"*A.r*   N)rE   rF   rG   r  r  r  r  r  rH   r*   r(   r  r    s    '
////r*   r  )unittesturwid.compatr   urwid.tests.utilr   r   TestCaser   rJ   rs   r   r  rH   r*   r(   <module>r     sw      + V+("3"3 V+rj(X.. j(\]9)) ]9@I(++ IX(/X.. (/r*   