mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(tests): make use of BECDockArea with client mixin to start server and use it in tests
Depending on the test, auto-updates are enabled or not.
This commit is contained in:
@ -5,9 +5,9 @@ from contextlib import contextmanager
|
||||
import pytest
|
||||
from bec_lib.endpoints import MessageEndpoints
|
||||
|
||||
from bec_widgets.cli.client import BECDockArea
|
||||
from bec_widgets.cli.client_utils import _start_plot_process
|
||||
from bec_widgets.utils import BECDispatcher
|
||||
from bec_widgets.widgets.containers.dock import BECDockArea
|
||||
from bec_widgets.widgets.containers.figure import BECFigure
|
||||
|
||||
|
||||
@ -48,5 +48,20 @@ def rpc_server_figure(gui_id, bec_client_lib):
|
||||
|
||||
@pytest.fixture
|
||||
def rpc_server_dock(gui_id, bec_client_lib):
|
||||
with plot_server(gui_id, BECDockArea, bec_client_lib) as server:
|
||||
yield server
|
||||
dock_area = BECDockArea(gui_id=gui_id)
|
||||
dock_area._auto_updates_enabled = False
|
||||
try:
|
||||
dock_area.start_server(wait=True)
|
||||
yield dock_area
|
||||
finally:
|
||||
dock_area.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def rpc_server_dock_w_auto_updates(gui_id, bec_client_lib):
|
||||
dock_area = BECDockArea(gui_id=gui_id)
|
||||
try:
|
||||
dock_area.start_server(wait=True)
|
||||
yield dock_area
|
||||
finally:
|
||||
dock_area.close()
|
||||
|
Reference in New Issue
Block a user