File: test_LinuxDeployLocalFilePlugin__properties.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 (34 lines) | stat: -rw-r--r-- 1,161 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
30
31
32
33
34
import pytest

from briefcase.integrations.linuxdeploy import LinuxDeployLocalFilePlugin


@pytest.fixture
def linuxdeploy_local_file_plugin(mock_tools, tmp_path):
    return LinuxDeployLocalFilePlugin(
        mock_tools,
        plugin_path=tmp_path / "path/to/linuxdeploy-plugin-custom.sh",
        bundle_path=tmp_path / "bundle",
    )


def test_file_path(linuxdeploy_local_file_plugin, tmp_path):
    """Local file plugins are kept in the bundle."""
    assert linuxdeploy_local_file_plugin.file_path == tmp_path / "bundle"


def test_file_name(linuxdeploy_local_file_plugin):
    """Local file plugin filename is as provided."""
    assert linuxdeploy_local_file_plugin.file_name == "linuxdeploy-plugin-custom.sh"


def test_plugin_id(linuxdeploy_local_file_plugin):
    """The custom plugin ID can be determined from the filename."""
    assert linuxdeploy_local_file_plugin.plugin_id == "custom"


def test_download_url(linuxdeploy_local_file_plugin):
    """Local file plugins don't have a download URL."""
    # Local file plugins don't have download URL.
    with pytest.raises(RuntimeError):
        _ = linuxdeploy_local_file_plugin.download_url