From d996ff92843b915d139cae8586db2606d253ffb3 Mon Sep 17 00:00:00 2001 From: Mathias Guijarro Date: Tue, 27 Feb 2024 13:53:23 +0100 Subject: [PATCH] fix(test): add a temporary test --- tests/test_problem.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/test_problem.py diff --git a/tests/test_problem.py b/tests/test_problem.py new file mode 100644 index 00000000..e695d55c --- /dev/null +++ b/tests/test_problem.py @@ -0,0 +1,26 @@ +import pytest + +from bec_widgets.cli.client import BECFigure +from bec_widgets.cli.server import BECWidgetsCLIServer +from bec_widgets.utils.bec_dispatcher import _BECDispatcher + + +@pytest.fixture +def rpc_server(qtbot): + # make a new dispatcher (not using the singleton), since the server is supposed to run in another process + dispatcher = _BECDispatcher() + server = BECWidgetsCLIServer(gui_id="id_test", dispatcher=dispatcher) + qtbot.addWidget(server.fig) + qtbot.waitExposed(server.fig) + qtbot.wait(200) + yield server + server.client.shutdown() + + +def test_rpc_waveform1d(rpc_server, qtbot): + fig = BECFigure(rpc_server.gui_id) + ax = fig.add_plot() + curve = ax.add_curve_custom([1, 2, 3], [1, 2, 3]) + curve.set_color("red") + curve = ax.curves[0] + curve.set_color("blue")