Skip to content

Commit

Permalink
Ensure coverage of Xcode run command.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Jun 7, 2021
1 parent 1dc9386 commit 6d8b68c
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion tests/platforms/macOS/xcode/test_run.py
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,
)
])

0 comments on commit 6d8b68c

Please sign in to comment.