forked from pwr-Solaar/Solaar
-
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.
Mocks view and thus does not require a GUI framework to run tests. Related pwr-Solaar#2395
- Loading branch information
Showing
3 changed files
with
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .about import show_window # noqa: F401 |
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,29 @@ | ||
from solaar.ui.about_dialog.model import AboutModel | ||
from solaar.ui.about_dialog.presenter import Presenter | ||
|
||
|
||
def test_about_model(): | ||
expected_name = "Daniel Pavel" | ||
model = AboutModel() | ||
|
||
authors = model.get_authors() | ||
|
||
assert expected_name in authors[0] | ||
|
||
|
||
def test_about_dialog(mocker): | ||
model = AboutModel() | ||
view = mocker.Mock() | ||
presenter = Presenter(model, view) | ||
|
||
presenter.run() | ||
|
||
assert view.init_ui.call_count == 1 | ||
assert view.update_version_info.call_count == 1 | ||
assert view.update_description.call_count == 1 | ||
assert view.update_authors.call_count == 1 | ||
assert view.update_credits.call_count == 1 | ||
assert view.update_copyright.call_count == 1 | ||
assert view.update_translators.call_count == 1 | ||
assert view.update_website.call_count == 1 | ||
assert view.show.call_count == 1 |