| 1 |
import pytest |
| 2 |
|
| 3 |
from briefcase.platforms.windows.app import WindowsAppCreateCommand |
| 4 |
|
| 5 |
|
| 6 |
@pytest.fixture |
| 7 |
def create_command(dummy_console, tmp_path): |
| 8 |
return WindowsAppCreateCommand( |
| 9 |
console=dummy_console, |
| 10 |
base_path=tmp_path / "base_path", |
| 11 |
data_path=tmp_path / "briefcase", |
| 12 |
) |
| 13 |
|
| 14 |
|
| 15 |
def test_binary_path(create_command, first_app_config, tmp_path): |
| 16 |
binary_path = create_command.binary_path(first_app_config) |
| 17 |
|
| 18 |
expected_path = ( |
| 19 |
tmp_path |
| 20 |
/ "base_path" |
| 21 |
/ "build" |
| 22 |
/ "first-app" |
| 23 |
/ "windows" |
| 24 |
/ "app" |
| 25 |
/ "src" |
| 26 |
/ "First App.exe" |
| 27 |
) |
| 28 |
assert binary_path == expected_path |
| 29 |
|
| 30 |
|
| 31 |
def test_project_path(create_command, first_app_config, tmp_path): |
| 32 |
"""The project path is the bundle path.""" |
| 33 |
project_path = create_command.project_path(first_app_config) |
| 34 |
bundle_path = create_command.bundle_path(first_app_config) |
| 35 |
|
| 36 |
expected_path = tmp_path / "base_path/build/first-app/windows/app" |
| 37 |
assert expected_path == project_path == bundle_path |
| 38 |
|
| 39 |
|
| 40 |
def test_distribution_path(create_command, first_app_config, tmp_path): |
| 41 |
distribution_path = create_command.distribution_path(first_app_config) |
| 42 |
|
| 43 |
expected_path = tmp_path / "base_path/dist/First App-0.0.1.msi" |
| 44 |
assert distribution_path == expected_path |