File: test_make_project_url.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 (19 lines) | stat: -rw-r--r-- 658 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
import pytest

from briefcase.config import validate_url


@pytest.mark.parametrize(
    "app_name, bundle, candidate",
    [
        ("some-app", "com.example", "https://example.com/some-app"),
        ("some_app", "com.example.more", "https://more.example.com/some_app"),
        ("myapp", "com.example", "https://example.com/myapp"),
    ],
)
def test_make_project_url(new_command, app_name, bundle, candidate):
    """An app name and bundle can be converted into a valid URL."""
    url = new_command.make_project_url(bundle, app_name)
    assert url == candidate
    # Double check - the app name passes the validity check.
    assert validate_url(url)