def test2_cursor(self):
T, E = urwid.Text, urwid.Edit
l1 = [T(""),T(""),T("\n"),E("","\n\nX"),T("\n"),T(""),T("")]
l2 = [T(""),T(""),T("\n"),E("","YY\n\n"),T("\n"),T(""),T("")]
l2[3].set_edit_pos(2)
self.cvtest( "plain cursor in view",
l1, 3, 1, (0,1), 1, (1,3) )
self.cvtest( "cursor off top",
l2, 3, 0, (1,3), 0, (2, 0) )
self.cvtest( "cursor further off top",
l2, 3, 0, (2,3), 0, (2, 0) )
self.cvtest( "cursor off bottom",
l1, 3, 3, (0,1), 2, (1, 4) )
self.cvtest( "cursor way off bottom",
l1, 3, 100, (0,1), 2, (1, 4) )
评论列表
文章目录