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 30 31 32
|
import shutil
from unittest.mock import MagicMock
import pytest
from briefcase.integrations.base import ToolCache
from briefcase.integrations.file import File
from briefcase.integrations.linuxdeploy import LinuxDeploy
from briefcase.integrations.subprocess import Subprocess
@pytest.fixture
def mock_tools(tmp_path, mock_tools) -> ToolCache:
mock_tools.host_os = "Linux"
mock_tools.host_arch = "i686"
# Mock default tools
mock_tools.subprocess = MagicMock(spec_set=Subprocess)
mock_tools.file = MagicMock(spec_set=File)
# Restore shutil
mock_tools.shutil = shutil
# Create a dummy bundle path
(tmp_path / "bundle").mkdir()
return mock_tools
@pytest.fixture
def linuxdeploy(mock_tools):
return LinuxDeploy(mock_tools)
|