Files
AareDAQ/tests/unit/gui/test_axis_video_panel.py
T
duan_j 0696b583b0
CI / test-with-coverage (pull_request) Successful in 2m23s
CI / lint (pull_request) Successful in 47s
CI / test (3.12) (pull_request) Successful in 58s
CI / test (3.13) (pull_request) Successful in 1m3s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m6s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m6s
CI / test (3.14) (pull_request) Successful in 2m18s
CI / coverage-analysis (pull_request) Successful in 3s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 3m27s
Docs build and publish / docker (push) Successful in 4s
CI / lint (push) Canceled after 34s
CI / test (3.12) (push) Canceled after 34s
CI / test (3.13) (push) Canceled after 29s
CI / test (3.14) (push) Canceled after 29s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 24s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 24s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 19s
CI / test-with-coverage (push) Canceled after 19s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 15s
test: no need to compare wording
2026-09-02 09:13:08 +02:00

37 lines
1.2 KiB
Python

from aarecommon.models.models import SessionsStateEnum
from PySide6.QtWidgets import QVBoxLayout, QWidget
from aare.gui.panels.axis_video_panel import AxisVideoPanel
from aare.gui.widgets.busy_overlay import build_busy_overlay_style
from aare.gui.widgets.video_image import VideoGraphicsView
def _vacant_style():
return build_busy_overlay_style(
is_busy=False, tell_state=None, session_state=SessionsStateEnum.Vacant
)
def test_badge_drawn_once_and_hint_stripped(qtbot):
# Combined-view shape: two video views stacked in one container.
container = QWidget()
layout = QVBoxLayout(container)
first, second = VideoGraphicsView(), VideoGraphicsView()
layout.addWidget(first)
layout.addWidget(second)
panel = AxisVideoPanel("Combined", container)
qtbot.addWidget(panel)
style = _vacant_style()
assert style is not None and style.subtext # sample camera keeps the hint
panel.set_busy_style(style)
applied = first._busy_overlay_style
assert applied is not None
assert applied.subtext == "" # not clickable here, hint stripped
assert second._busy_overlay_style is None # one badge, not one per view
panel.set_busy_style(None)
assert first._busy_overlay_style is None