Esempio n. 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"
Esempio n. 2
0
def test_panel_gather_one_screen():
    p = Panel(instance_per_screen=False, keep_unplugged_screens=True)
    w = TextWidget(text="test")

    s = Screen()
    p.add_screen(s)
    s.add_widget("l", w)
    w.update()

    assert p.gather() == "%{l}test"
Esempio n. 3
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"
Esempio n. 4
0
def test_base_textwidget():
    tw = TextWidget(text="Test")
    tw.update()

    assert tw.content == "Test"