def test_moving_focus_up_down(self):
w = Scrollable(
urwid.Pile([urwid.Text('t1'),
urwid.Text('t2'),
urwid.Edit('', 'e3'),
urwid.Text('t4'),
urwid.Text('t5'),
urwid.Edit('', 'e6'),
urwid.Text('t7'),
urwid.Text('t8')])
)
size = (10, 2)
self.check(w, size, text=('t1'.ljust(size[0]),
't2'.ljust(size[0])))
w.keypress(size, 'down')
self.check(w, size, text=('t2'.ljust(size[0]),
'e3'.ljust(size[0])))
w.keypress(size, 'down')
self.check(w, size, text=('t5'.ljust(size[0]),
'e6'.ljust(size[0])))
w.keypress(size, 'down')
self.check(w, size, text=('e6'.ljust(size[0]),
't7'.ljust(size[0])))
w.keypress(size, 'down')
self.check(w, size, text=('t7'.ljust(size[0]),
't8'.ljust(size[0])))
评论列表
文章目录