mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 19:21:50 +02:00
27 lines
764 B
Python
27 lines
764 B
Python
# pylint: disable=missing-function-docstring, missing-module-docstring, unused-import
|
|
|
|
import pytest
|
|
|
|
from bec_widgets.widgets.control.buttons.button_abort.button_abort import AbortButton
|
|
|
|
from .client_mocks import mocked_client
|
|
|
|
|
|
@pytest.fixture
|
|
def abort_button(qtbot, mocked_client):
|
|
widget = AbortButton(client=mocked_client)
|
|
qtbot.addWidget(widget)
|
|
qtbot.waitExposed(widget)
|
|
yield widget
|
|
|
|
|
|
def test_abort_button(abort_button):
|
|
assert abort_button.button.text() == "Abort"
|
|
assert (
|
|
abort_button.button.styleSheet()
|
|
== "background-color: #666666; color: white; font-weight: bold; font-size: 12px;"
|
|
)
|
|
abort_button.button.click()
|
|
assert abort_button.queue.request_scan_abortion.called
|
|
abort_button.close()
|