File: test_mixin.py

package info (click to toggle)
python-briefcase 0.3.25-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,596 kB
  • sloc: python: 62,519; makefile: 60
file content (55 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import pytest

from briefcase.platforms.web.static import StaticWebCreateCommand


@pytest.fixture
def create_command(dummy_console, tmp_path):
    return StaticWebCreateCommand(
        console=dummy_console,
        base_path=tmp_path / "base_path",
        data_path=tmp_path / "briefcase",
    )


def test_project_path(create_command, first_app_config, tmp_path):
    project_path = create_command.project_path(first_app_config)

    assert project_path == (tmp_path / "base_path/build/first-app/web/static/www")


def test_binary_path(create_command, first_app_config, tmp_path):
    binary_path = create_command.binary_path(first_app_config)

    assert binary_path == (
        tmp_path
        / "base_path"
        / "build"
        / "first-app"
        / "web"
        / "static"
        / "www"
        / "index.html"
    )


def test_wheel_path(create_command, first_app_config, tmp_path):
    wheel_path = create_command.wheel_path(first_app_config)

    assert wheel_path == (
        tmp_path
        / "base_path"
        / "build"
        / "first-app"
        / "web"
        / "static"
        / "www"
        / "static"
        / "wheels"
    )


def test_distribution_path(create_command, first_app_config, tmp_path):
    distribution_path = create_command.distribution_path(first_app_config)

    assert distribution_path == (tmp_path / "base_path/dist/First App-0.0.1.web.zip")