mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix(abort_button): abort button added; some minor fixes
This commit is contained in:
26
tests/unit_tests/test_abort_button.py
Normal file
26
tests/unit_tests/test_abort_button.py
Normal 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()
|
@ -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
|
||||
|
Reference in New Issue
Block a user