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
|
import pytest
from briefcase.integrations.linuxdeploy import LinuxDeployURLPlugin
@pytest.fixture
def linuxdeploy_url_plugin(mock_tools):
return LinuxDeployURLPlugin(
mock_tools,
url="https://example.com/path/to/linuxdeploy-plugin-foobar.sh",
)
def test_file_path(mock_tools, linuxdeploy_url_plugin):
"""Custom URL plugins are in the linuxdeploy plugins folder, behind a hash."""
assert (
linuxdeploy_url_plugin.file_path
== mock_tools.base_path
/ "linuxdeploy_plugins"
/ "foobar"
/ "dc66c26aaeb8083777d1975e55dfb5c197b5b54e7b46481793eab4b3f2ace1b3"
)
def test_file_name(linuxdeploy_url_plugin):
"""Custom URL plugin filenames come from the URL."""
assert linuxdeploy_url_plugin.file_name == "linuxdeploy-plugin-foobar.sh"
def test_plugin_id(linuxdeploy_url_plugin):
"""The Custom URL plugin ID can be determined from the filename."""
assert linuxdeploy_url_plugin.plugin_id == "foobar"
def test_download_url(linuxdeploy_url_plugin):
"""The download URL for the plugin is as-provided."""
assert linuxdeploy_url_plugin.download_url == (
"https://example.com/path/to/linuxdeploy-plugin-foobar.sh"
)
|