diff options
author | Ian Ward <ian@excess.org> | 2012-10-17 12:25:15 -0400 |
---|---|---|
committer | Ian Ward <ian@excess.org> | 2012-10-17 12:25:15 -0400 |
commit | 9f1109e6cd095723ed51545ae9f6fb74666d4236 (patch) | |
tree | 881bf8c78516b9ef004f4159765378f81ef32c37 /urwid | |
parent | d06ce5741056a6bf327512f5efd9bce69369dfa2 (diff) | |
download | urwid-9f1109e6cd095723ed51545ae9f6fb74666d4236.tar.gz |
test to expose columns rows() and get_cursor_coords() regressions
Diffstat (limited to 'urwid')
-rwxr-xr-x | urwid/tests.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/urwid/tests.py b/urwid/tests.py index 2714aea..651275c 100755 --- a/urwid/tests.py +++ b/urwid/tests.py @@ -2383,6 +2383,19 @@ class WidgetSquishTest(unittest.TestCase): c = w.render((0, 25), focus=False) c = w.render((1, 25), focus=False) + def fwstest(self, w): + def t(cols, focus): + wrows = w.rows((cols,), focus) + c = w.render((cols,), focus) + assert c.rows() == wrows, (c.rows(), wrows) + if c.cursor: + gcc = w.get_cursor_coords((cols,)) + assert c.cursor == gcc, (c.cursor, gcc) + t(0, False) + t(1, False) + t(0, True) + t(1, True) + def test_listbox(self): self.wstest(urwid.ListBox([])) self.wstest(urwid.ListBox([urwid.Text("hello")])) @@ -2426,6 +2439,10 @@ class WidgetSquishTest(unittest.TestCase): self.wstest(urwid.Columns([urwid.SolidFill()])) self.wstest(urwid.Columns([(4, urwid.SolidFill())])) + def test_buttons(self): + self.fwstest(urwid.Button(u"hello")) + self.fwstest(urwid.RadioButton([], u"hello")) + class CommonContainerTest(unittest.TestCase): def test_pile(self): |