0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

fix(abort_button): abort button added; some minor fixes

This commit is contained in:
2024-08-29 14:07:52 +02:00
parent 6a919be88f
commit a568633c32
11 changed files with 179 additions and 6 deletions

View File

@ -0,0 +1,26 @@
# pylint: disable=missing-function-docstring, missing-module-docstring, unused-import
import pytest
from bec_widgets.widgets.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()

View File

@ -19,7 +19,7 @@ def test_resume_button(resume_button):
assert resume_button.button.text() == "Resume"
assert (
resume_button.button.styleSheet()
== "background-color: #2793e8 color: white; font-weight: bold; font-size: 12px;"
== "background-color: #2793e8; color: white; font-weight: bold; font-size: 12px;"
)
resume_button.button.click()
assert resume_button.queue.request_scan_continuation.called