def root(stdscr): root = Widget(None) # Run all tests with a resolution # of 18 rows and 90 cols stdscr.resize(18, 90) root.window = stdscr return
def test_widget_render_with_window(root): widget = Widget(None) widget.window = root.window widget.content = 'Hello World' widget.pin(1, 2).render() window_text = widget.window.instr(0, 0, 11) assert isinstance(widget, Widget) assert widget.window is not None assert window_text == b'Hello World'