mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 19:21:50 +02:00
fix(launch_window): number of remaining connections increase to 2 to include the ScanProgressBar
This commit is contained in:
@ -542,7 +542,7 @@ class LaunchWindow(BECMainWindow):
|
|||||||
remaining_connections = [
|
remaining_connections = [
|
||||||
connection for connection in connections.values() if connection.parent_id != self.gui_id
|
connection for connection in connections.values() if connection.parent_id != self.gui_id
|
||||||
]
|
]
|
||||||
return len(remaining_connections) <= 1
|
return len(remaining_connections) <= 2
|
||||||
|
|
||||||
def _turn_off_the_lights(self, connections: dict):
|
def _turn_off_the_lights(self, connections: dict):
|
||||||
"""
|
"""
|
||||||
|
@ -79,7 +79,7 @@ def test_available_widgets(qtbot, connected_client_gui_obj):
|
|||||||
gui = connected_client_gui_obj
|
gui = connected_client_gui_obj
|
||||||
dock_area = gui.bec
|
dock_area = gui.bec
|
||||||
# Number of top level widgets, should be 4
|
# Number of top level widgets, should be 4
|
||||||
top_level_widgets_count = 4
|
top_level_widgets_count = 8
|
||||||
assert len(gui._server_registry) == top_level_widgets_count
|
assert len(gui._server_registry) == top_level_widgets_count
|
||||||
# Number of widgets with parent_id == None, should be 2
|
# Number of widgets with parent_id == None, should be 2
|
||||||
widgets = [
|
widgets = [
|
||||||
|
@ -102,7 +102,15 @@ def test_launch_window_launch_plugin_auto_update(bec_launch_window):
|
|||||||
[
|
[
|
||||||
({}, False),
|
({}, False),
|
||||||
({"launcher": mock.MagicMock()}, False),
|
({"launcher": mock.MagicMock()}, False),
|
||||||
({"launcher": mock.MagicMock(), "dock_area": mock.MagicMock()}, True),
|
({"launcher": mock.MagicMock(), "dock_area": mock.MagicMock()}, False),
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"launcher": mock.MagicMock(),
|
||||||
|
"dock_area": mock.MagicMock(),
|
||||||
|
"scan_progress": mock.MagicMock(),
|
||||||
|
},
|
||||||
|
True,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_gui_server_turns_off_the_lights(bec_launch_window, connections, hide):
|
def test_gui_server_turns_off_the_lights(bec_launch_window, connections, hide):
|
||||||
@ -132,7 +140,15 @@ def test_gui_server_turns_off_the_lights(bec_launch_window, connections, hide):
|
|||||||
[
|
[
|
||||||
({}, True),
|
({}, True),
|
||||||
({"launcher": mock.MagicMock()}, True),
|
({"launcher": mock.MagicMock()}, True),
|
||||||
({"launcher": mock.MagicMock(), "dock_area": mock.MagicMock()}, False),
|
({"launcher": mock.MagicMock(), "dock_area": mock.MagicMock()}, True),
|
||||||
|
(
|
||||||
|
{
|
||||||
|
"launcher": mock.MagicMock(),
|
||||||
|
"dock_area": mock.MagicMock(),
|
||||||
|
"scan_progress": mock.MagicMock(),
|
||||||
|
},
|
||||||
|
False,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_launch_window_closes(bec_launch_window, connections, close_called):
|
def test_launch_window_closes(bec_launch_window, connections, close_called):
|
||||||
|
Reference in New Issue
Block a user