-
-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage of new core app classes.
- Loading branch information
1 parent
39316be
commit 4389855
Showing
7 changed files
with
127 additions
and
12 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
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 unittest.mock import Mock | ||
|
||
import toga | ||
from toga_dummy.utils import assert_action_performed | ||
|
||
|
||
def test_simple_app(): | ||
"""A SimpleApp could be created""" | ||
on_exit_handler = Mock() | ||
|
||
app = toga.SimpleApp( | ||
formal_name="Test App", | ||
app_id="org.example.test-app", | ||
author="Jane Developer", | ||
version="1.2.3", | ||
home_page="https://example.com/test-app", | ||
description="A test app", | ||
on_exit=on_exit_handler, | ||
) | ||
|
||
assert app.author == "Jane Developer" | ||
assert app.version == "1.2.3" | ||
assert app.home_page == "https://example.com/test-app" | ||
assert app.description == "A test app" | ||
|
||
assert app.on_exit._raw == on_exit_handler | ||
|
||
# A simple app was created. | ||
assert_action_performed(app, "create Simple App") |
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 unittest.mock import Mock | ||
|
||
import toga | ||
from toga_dummy.utils import assert_action_performed | ||
|
||
|
||
def test_windowless_app(): | ||
"""A WindowlessApp could be created""" | ||
on_exit_handler = Mock() | ||
|
||
app = toga.WindowlessApp( | ||
formal_name="Test App", | ||
app_id="org.example.test-app", | ||
author="Jane Developer", | ||
version="1.2.3", | ||
home_page="https://example.com/test-app", | ||
description="A test app", | ||
on_exit=on_exit_handler, | ||
) | ||
|
||
assert app.author == "Jane Developer" | ||
assert app.version == "1.2.3" | ||
assert app.home_page == "https://example.com/test-app" | ||
assert app.description == "A test app" | ||
|
||
assert app.on_exit._raw == on_exit_handler | ||
|
||
# A windowless app was created. | ||
assert_action_performed(app, "create Windowless App") |
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