stig
stig copied to clipboard
TestScrollBarWithScrollable.test_wrapping_bug fails
I had to disable TestScrollBarWithScrollable.test_wrapping_bug when packaging stig 0.11.0a here: https://github.com/NixOS/nixpkgs/pull/89557
It fails with a message I cannot cleanly copy/paste here due to Termux's bugginess, but here it is nevertheless if you cannot reproduce:
________________ TestScrollBarWithScrollable.test_wrapping_bug _________________ self = <tui_test.scroll_test.TestScrollBarWithScrollable testMethod=test_wrapping_bug> def test_wrapping_bug(self): scrl = Scrollable( urwid.Pile([urwid.Columns([urwid.Text("long text")] * 2)] * 2) ) sb = ScrollBar(scrl, thumb_char='#', trough_char='|', width=3)
widget = urwid.Columns([urwid.Pile([urwid.LineBox(sb)])] * 2) self.check(widget, (9, 6), cursor_pos=(), text=( > '┌───┐┌──┐', '│###││##│', '│###││##│',
'│###││##│', '│###││##│', '└───┘└──┘',
)) tests/tui_test/scroll_test.py:457:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/tui_test/scroll_test.py:312: in check
self.assertEqual(content, content_exp) E AssertionError: Tuples differ: ('lqqqklqqk', 'x###xx##x', 'x###xx##x', 'x###xx##x', 'x###xx##x', 'mqqqjmqqj') != ('┌───┐┌──┐', '│###││##│', '│###││##│',
'│###││##│', '│###││##│', '└───┘└──┘') E E First differing element 0:
E 'lqqqklqqk' E '┌───┐┌──┐' E
E - ('lqqqklqqk', 'x###xx##x', 'x###xx##x', 'x###xx##x', 'x###xx##x', 'mqqqjmqqj') E + ('┌───┐┌──┐', '│###││##│', '│###││##│', '│###││##│', '│###││##│', '└───┘
└──┘')
IIRC, there was a bug reported by someone who is using the ScrollBar and/or Scrollable widgets in their own project. Even though stig doesn't seem to suffer from this particular bug, they kindly fixed it and wrote this test for it.
Unless this bug manifests with stig, I'm probably not going to look into this as my next goal is to switch to another TUI toolkit and these classes and tests will be removed.
But thanks for the report nonetheless.