scroll_test.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:stig 作者: rndusr 项目源码 文件源码
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])))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号