-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The GUI is rather useless when the app is being run in the test environment, as there are no printers connected (there is no USB backend at all). This simple test verifies the most basic existence of selected widget, and their content. We will need to figure out how to test the app with a state that resembles actual printer. We might need to introduce test mode, in which all supported printers are shown in the device selector, so we can test various features for each.
- Loading branch information
Tomer Shalev
committed
May 4, 2024
1 parent
c024563
commit 3ae54e2
Showing
3 changed files
with
29 additions
and
2 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,25 @@ | ||
from labelle.gui.gui import LabelleWindow | ||
from labelle.gui.q_label_widgets import ( | ||
TextDymoLabelWidget, | ||
) | ||
|
||
|
||
def test_main_window(qtbot): | ||
widget = LabelleWindow() | ||
qtbot.addWidget(widget) | ||
|
||
assert not widget._actions.isEnabled() | ||
assert widget._device_selector.isEnabled() | ||
assert not widget._label_list.isEnabled() | ||
assert not widget._render_widget.isEnabled() | ||
assert not widget._render.isEnabled() | ||
assert not widget._settings_toolbar.isEnabled() | ||
assert ( | ||
widget._device_selector._error_label.text() | ||
== "Failed scanning devices: No backend available" | ||
) | ||
assert not widget._actions._print_button.isEnabled() | ||
assert widget._label_list.count() == 1 | ||
item = widget._label_list.itemWidget(widget._label_list.item(0)) | ||
assert isinstance(item, TextDymoLabelWidget) | ||
assert item.label.toPlainText() == "text" |