summaryrefslogtreecommitdiff
path: root/urwid
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2012-10-17 12:25:15 -0400
committerIan Ward <ian@excess.org>2012-10-17 12:25:15 -0400
commit9f1109e6cd095723ed51545ae9f6fb74666d4236 (patch)
tree881bf8c78516b9ef004f4159765378f81ef32c37 /urwid
parentd06ce5741056a6bf327512f5efd9bce69369dfa2 (diff)
downloadurwid-9f1109e6cd095723ed51545ae9f6fb74666d4236.tar.gz
test to expose columns rows() and get_cursor_coords() regressions
Diffstat (limited to 'urwid')
-rwxr-xr-xurwid/tests.py17
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):