-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fb2e11
commit d17677c
Showing
1 changed file
with
27 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
import sys | ||
|
||
import pytest | ||
|
||
from buzz.widgets.model_type_combo_box import ModelTypeComboBox | ||
|
||
|
||
class TestModelTypeComboBox: | ||
def test_should_display_items(self, qtbot): | ||
@pytest.mark.parametrize( | ||
"model_types", | ||
[ | ||
pytest.param( | ||
[ | ||
"Whisper", | ||
"Whisper.cpp", | ||
"Hugging Face", | ||
"Faster Whisper", | ||
"OpenAI Whisper API", | ||
], | ||
pytest.mark.skipif(sys.platform == "linux", reason="Skip on Linux"), | ||
), | ||
pytest.param( | ||
["Whisper.cpp", "OpenAI Whisper API"], | ||
pytest.mark.skipif(sys.platform != "linux", reason="Skip on non-Linux"), | ||
), | ||
], | ||
) | ||
def test_should_display_items(self, qtbot, model_types): | ||
widget = ModelTypeComboBox() | ||
qtbot.add_widget(widget) | ||
|
||
assert widget.count() == 5 | ||
assert widget.itemText(0) == "Whisper" | ||
assert widget.itemText(1) == "Whisper.cpp" | ||
assert widget.itemText(2) == "Hugging Face" | ||
assert widget.itemText(3) == "Faster Whisper" | ||
assert widget.itemText(4) == "OpenAI Whisper API" | ||
assert widget.count() == len(model_types) | ||
for index, model_type in enumerate(model_types): | ||
assert widget.itemText(index) == model_type |