Skip to content

Commit

Permalink
Test about window
Browse files Browse the repository at this point in the history
Mocks view and thus does not require a GUI framework for tests.

Related pwr-Solaar#2395
  • Loading branch information
MattHag committed Apr 6, 2024
1 parent dfc3160 commit ef5b4a2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/solaar/ui/test_about_window.py
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

0 comments on commit ef5b4a2

Please sign in to comment.