File: test_verify_command_line_tools_install.py

package info (click to toggle)
python-briefcase 0.3.22-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,300 kB
  • sloc: python: 59,405; makefile: 57
file content (29 lines) | stat: -rw-r--r-- 832 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from subprocess import CalledProcessError
from unittest import mock

from briefcase.integrations.xcode import XcodeCliTools


def test_verify_command_line_tools_install(mock_tools):
    """Xcode CLI tools can be verified."""
    mock_tools.subprocess.check_output.side_effect = [
        CalledProcessError(cmd=["xcode-select", "--install"], returncode=1),
        "clang 37.42",  # clang --version
    ]

    XcodeCliTools.verify(mock_tools)

    # The command line tools are verified
    assert mock_tools.xcode_cli is not None


def test_reverify_command_line_tools_install(mock_tools):
    """A second call to verify is a no-op."""

    xcode_cli = mock.MagicMock()
    mock_tools.xcode_cli = xcode_cli

    XcodeCliTools.verify(mock_tools)

    # The command line tools are verified
    assert mock_tools.xcode_cli is not None