mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 19:21:50 +02:00
wip improve tsts
This commit is contained in:
@ -165,14 +165,21 @@ def test_scan_history_device_viewer_on_request_plotting_clicked(
|
|||||||
"""Test the request plotting button click."""
|
"""Test the request plotting button click."""
|
||||||
scan_history_device_viewer.update_devices_from_scan_history(scan_history_msg)
|
scan_history_device_viewer.update_devices_from_scan_history(scan_history_msg)
|
||||||
|
|
||||||
|
plotting_callback_args = []
|
||||||
|
|
||||||
def plotting_callback(device_name, signal_name, msg):
|
def plotting_callback(device_name, signal_name, msg):
|
||||||
"""Callback to check if the request plotting signal is emitted."""
|
"""Callback to check if the request plotting signal is emitted."""
|
||||||
assert device_name == "device2"
|
plotting_callback_args.append((device_name, signal_name, msg))
|
||||||
|
|
||||||
assert msg == scan_history_msg
|
|
||||||
|
|
||||||
scan_history_device_viewer.request_history_plot.connect(plotting_callback)
|
scan_history_device_viewer.request_history_plot.connect(plotting_callback)
|
||||||
qtbot.mouseClick(scan_history_device_viewer.request_plotting_button, QtCore.Qt.LeftButton)
|
qtbot.mouseClick(scan_history_device_viewer.request_plotting_button, QtCore.Qt.LeftButton)
|
||||||
|
qtbot.waitUntil(lambda: len(plotting_callback_args) > 0, timeout=5000)
|
||||||
|
assert plotting_callback_args[0][2] == scan_history_msg
|
||||||
|
assert plotting_callback_args[0][0] in scan_history_msg.stored_data_info.keys()
|
||||||
|
assert (
|
||||||
|
plotting_callback_args[0][1]
|
||||||
|
in scan_history_msg.stored_data_info[plotting_callback_args[0][0]].keys()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_scan_history_metadata_viewer_receive_msg(
|
def test_scan_history_metadata_viewer_receive_msg(
|
||||||
|
Reference in New Issue
Block a user