-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move qtpy functionality from cellfinder
- Loading branch information
1 parent
8e96563
commit 0f1f5d6
Showing
3 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pytest | ||
from qtpy.QtWidgets import QGridLayout | ||
|
||
from brainglobe_utils.qtpy.interaction import add_button, add_combobox | ||
|
||
|
||
@pytest.mark.parametrize("label_stack", [True, False]) | ||
@pytest.mark.parametrize("label", ["A label", None]) | ||
def test_add_combobox(label, label_stack): | ||
""" | ||
Smoke test for add_combobox for all conditional branches | ||
""" | ||
layout = QGridLayout() | ||
combobox = add_combobox( | ||
layout, | ||
row=0, | ||
label=label, | ||
items=["item 1", "item 2"], | ||
label_stack=label_stack, | ||
) | ||
assert combobox is not None | ||
|
||
|
||
@pytest.mark.parametrize( | ||
argnames="alignment", argvalues=["center", "left", "right"] | ||
) | ||
def test_add_button(alignment): | ||
""" | ||
Smoke tests for add_button for all conditional branches | ||
""" | ||
layout = QGridLayout() | ||
button = add_button( | ||
layout=layout, | ||
connected_function=lambda: None, | ||
label="A button", | ||
row=0, | ||
alignment=alignment, | ||
) | ||
assert button is not None |