File: test_input_description.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 (21 lines) | stat: -rw-r--r-- 967 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
def test_pep621_data_is_used(convert_command):
    """The PEP621-description is used if present."""
    (convert_command.base_path / "pyproject.toml").write_text(
        '[project]\ndescription="Some description"', encoding="utf-8"
    )
    assert convert_command.input_description(None) == "Some description"


def test_override_is_used(convert_command):
    """The override is used even if a PEP621-description is present."""
    (convert_command.base_path / "pyproject.toml").write_text(
        '[project]\ndescription="Some description"', encoding="utf-8"
    )
    assert convert_command.input_description("OVERRIDE TEXT") == "OVERRIDE TEXT"


def test_prompted_description(convert_command):
    """The user is prompted for a description if there is no description in the
    pyproject.toml file."""
    convert_command.console.values = ["A very descriptive description"]
    assert convert_command.input_description(None) == "A very descriptive description"