Ejemplo n.º 1
0
def test_panel_gather_no_screen(fixture_useful_screens):
    p = Panel(instance_per_screen=False, keep_unplugged_screens=True)
    disable_spawn_bar(p)
    p.gather()
    try:
        threading.Thread(target=p.start).start()
        time.sleep(0.1)
        assert p.gather() == ""
    finally:
        p.stop()
Ejemplo n.º 2
0
def test_base_lock_update(mocker):
    """
    Test that only one update is running at a time by widget
    """
    disable_spawn_bar(Panel)
    p = Panel(instance_per_screen=False, keep_unplugged_screens=True)
    w = SubprocessWidget(cmd="echo Test", refresh=0.2)
    for i in range(0, 4):
        s = Screen()
        s.add_widget("l", w)
        p.add_screen(s)
    mocker.spy(w, "continuous_update")

    try:
        threading.Thread(target=p.start).start()
        time.sleep(0.3)
        assert w.continuous_update.call_count == 1
    finally:
        p.stop()