Example #1
0
def test_screen_gather():
    p = Panel(keep_unplugged_screens=True)
    s = Screen()
    p.add_screen(s)
    w = TextWidget(text="test")
    s.add_widget("l", w)
    w.update()

    content = s.gather()
    assert content == "%{l}test"
Example #2
0
def test_screen_gather_multiple_widgets():
    """
    Test the gather function with more than one widget
    """
    p = Panel(keep_unplugged_screens=True)
    s = Screen()
    p.add_screen(s)
    w = TextWidget(text="test")
    w1 = TextWidget(text="test1")
    s.add_widget("l", w, w1)
    w.update()
    w1.update()

    s.add_widget("r", w, w1)
    s.add_widget("c", w, w1)

    content = s.gather()
    assert content == "%{l}testtest1%{c}testtest1%{r}testtest1"