mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-11-10 19:44:04 +01:00
test: add and remove dockarea items causing issue
This commit is contained in:
1 parent
f10140e0f3
commit
0155ceccc8
1 file changed
+42
@@ -0,0 +1,42 @@
|
||||
import pytest
|
||||
from qtpy.QtCore import Qt
|
||||
|
||||
from bec_widgets.widgets.containers.dock.dock_area import BECDockArea
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dock_area(qtbot):
|
||||
|
||||
dock = BECDockArea()
|
||||
qtbot.addWidget(dock)
|
||||
qtbot.waitExposed(dock)
|
||||
dock.show()
|
||||
qtbot.wait(500)
|
||||
|
||||
yield dock
|
||||
|
||||
dock.remove()
|
||||
dock.deleteLater()
|
||||
|
||||
|
||||
def test_sequence_of_add_and_remove(qtbot, dock_area):
|
||||
|
||||
add_sc_action = dock_area.toolbar.widgets["menu_devices"].widgets["scan_control"]
|
||||
add_pb_action = dock_area.toolbar.widgets["menu_devices"].widgets["positioner_box"]
|
||||
|
||||
add_pb_action.trigger()
|
||||
qtbot.wait(1000)
|
||||
|
||||
add_sc_action.trigger()
|
||||
qtbot.wait(1000)
|
||||
|
||||
assert all(w in dock_area.panels for w in ["positioner_box_0", "scan_control_0"])
|
||||
|
||||
dock_area.panels["positioner_box_0"].remove()
|
||||
qtbot.wait(1000)
|
||||
|
||||
dock_area.panels["scan_control_0"].remove()
|
||||
qtbot.wait(1000)
|
||||
|
||||
add_pb_action.trigger()
|
||||
qtbot.wait(1000)
|
||||
Reference in new issue
Block a user