-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When using the convert wizard, the user is now prompted to confirm if the app is a console app or a GUI app. Co-authored-by: logan keede <logan@logan.logan> Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
- Loading branch information
1 parent
93b3520
commit aa1f5d9
Showing
6 changed files
with
72 additions
and
6 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 @@ | ||
The "briefcase convert" command can now be used to configure a console-based applications. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
def test_overrides_are_not_used(convert_command): | ||
overrides = {"gui_framework": "Toga"} | ||
def test_overrides_are_used(convert_command): | ||
overrides = {"gui_framework": "Toga", "console_app": "Console"} | ||
out = convert_command.build_gui_context({}, overrides) | ||
assert out == {"gui_framework": "None"} | ||
assert out == {"gui_framework": "None", "console_app": True} | ||
assert overrides == {"gui_framework": "Toga"} |
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,33 @@ | ||
import pytest | ||
|
||
|
||
def test_overrides_are_used_for_console(convert_command): | ||
overrides = {"console_app": "Console"} | ||
out = convert_command.build_gui_context({}, overrides) | ||
assert out == {"console_app": True, "gui_framework": "None"} | ||
|
||
|
||
def test_overrides_are_used_for_GUI(convert_command): | ||
overrides = {"console_app": "GUI"} | ||
out = convert_command.build_gui_context({}, overrides) | ||
assert out == {"console_app": False, "gui_framework": "None"} | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"input, result", | ||
[ | ||
# A GUI app | ||
(["1"], False), | ||
# A console app | ||
(["2"], True), | ||
# Default value is False (GUI app) | ||
([""], False), | ||
# Invalid values are rejected until a valid value is provided. | ||
(["x", "y", "2"], True), | ||
], | ||
) | ||
def test_app_type(convert_command, input, result): | ||
"""The user can be asked for the app type.""" | ||
convert_command.input.values = input | ||
out = convert_command.input_console_app(None) | ||
assert out == result |
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