File: test_make_app_name.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 (23 lines) | stat: -rw-r--r-- 824 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
import pytest


@pytest.mark.parametrize(
    "formal_name, candidate",
    [
        ("Hello World", "helloworld"),
        ("Hello World!", "helloworld"),
        ("Hello! World", "helloworld"),
        ("Hello-World", "helloworld"),
        # Internationalized names that can be unicode-simplified
        ("Hallo Vögel", "hallovogel"),
        ("Bonjour Garçon", "bonjourgarcon"),
        # Internationalized names that cannot be unicode-simplified
        ("你好 世界", "myapp"),
    ],
)
def test_make_app_name(new_command, formal_name, candidate):
    """A formal name can be converted into a valid app name."""
    app_name = new_command.make_app_name(formal_name)
    assert app_name == candidate
    # Double check - the app name passes the validity check.
    assert new_command.validate_app_name(app_name)