forked from beeware/briefcase
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure coverage of Xcode run command.
- Loading branch information
1 parent
1dc9386
commit 6d8b68c
Showing
1 changed file
with
36 additions
and
1 deletion.
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 |
---|---|---|
@@ -1 +1,36 @@ | ||
# skip since run uses the same code as app command | ||
# Xcode uses the same run implementation as the base app; | ||
# Run a basic test to ensure coverage, but fall back to | ||
# the app backend for exhaustive tests. | ||
from unittest import mock | ||
|
||
from briefcase.platforms.macOS.xcode import macOSXcodeRunCommand | ||
|
||
|
||
def test_run_app(first_app_config, tmp_path): | ||
"A macOS Xcode app can be started" | ||
command = macOSXcodeRunCommand(base_path=tmp_path) | ||
command.subprocess = mock.MagicMock() | ||
|
||
command.run_app(first_app_config) | ||
|
||
# Calls were made to start the app and to start a log stream. | ||
bin_path = command.binary_path(first_app_config) | ||
command.subprocess.run.assert_has_calls([ | ||
mock.call( | ||
['open', '-n', str(bin_path)], | ||
check=True | ||
), | ||
mock.call( | ||
[ | ||
'log', 'stream', | ||
'--style', 'compact', | ||
'--predicate', | ||
'senderImagePath=="{sender}"' | ||
' OR (processImagePath=="{sender}"' | ||
' AND senderImagePath=="/usr/lib/libffi.dylib")'.format( | ||
sender=bin_path / "Contents" / "MacOS" / "First App" | ||
) | ||
], | ||
check=True, | ||
) | ||
]) |