diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:43:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:43:21 +0000 |
commit | 0bdb089380893d6d300f9a715aab0db0a7f718ef (patch) | |
tree | 3a564777bb206365223137abb1717ab0a0e868bc /tests/lint_tests | |
parent | Adding debian version 0.1.34. (diff) | |
download | debputy-0bdb089380893d6d300f9a715aab0db0a7f718ef.tar.xz debputy-0bdb089380893d6d300f9a715aab0db0a7f718ef.zip |
Merging upstream version 0.1.35.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lint_tests')
-rw-r--r-- | tests/lint_tests/test_lint_dctrl.py | 38 | ||||
-rw-r--r-- | tests/lint_tests/test_lint_debputy.py | 23 |
2 files changed, 61 insertions, 0 deletions
diff --git a/tests/lint_tests/test_lint_dctrl.py b/tests/lint_tests/test_lint_dctrl.py index c91d43d..7478461 100644 --- a/tests/lint_tests/test_lint_dctrl.py +++ b/tests/lint_tests/test_lint_dctrl.py @@ -497,6 +497,44 @@ def test_dctrl_lint_sv_udeb_only(line_linter: LintWrapper) -> None: assert not diagnostics +def test_dctrl_lint_udeb_menu_iten(line_linter: LintWrapper) -> None: + lines = textwrap.dedent( + """\ + Source: foo + Section: devel + Priority: optional + Maintainer: Jane Developer <jane@example.com> + Build-Depends: debhelper-compat (= 13) + + Package: foo-udeb + Architecture: all + Package-Type: udeb + Section: debian-installer + XB-Installer-Menu-Item: 12345 + Description: Some very interesting synopsis + A very interesting description + that spans multiple lines + . + Just so be clear, this is for a test. + + Package: bar-udeb + Architecture: all + Package-Type: udeb + Section: debian-installer + XB-Installer-Menu-Item: ${foo} + Description: Some very interesting synopsis + A very interesting description + that spans multiple lines + . + Just so be clear, this is for a test. + """ + ).splitlines(keepends=True) + + diagnostics = line_linter(lines) + print(diagnostics) + assert not diagnostics + + def test_dctrl_lint_multiple_vcs(line_linter: LintWrapper) -> None: lines = textwrap.dedent( f"""\ diff --git a/tests/lint_tests/test_lint_debputy.py b/tests/lint_tests/test_lint_debputy.py index 8e405f8..28dab00 100644 --- a/tests/lint_tests/test_lint_debputy.py +++ b/tests/lint_tests/test_lint_debputy.py @@ -85,6 +85,29 @@ def test_debputy_lint_unknown_keys(line_linter: LintWrapper) -> None: assert f"{fourth_error.range}" == "16:4-16:8" +def test_debputy_lint_null_keys(line_linter: LintWrapper) -> None: + lines = textwrap.dedent( + """\ + manifest-version: '0.1' + installations: + - install-docs: + : + - GETTING-STARTED-WITH-dh-debputy.md + - MANIFEST-FORMAT.md + - MIGRATING-A-DH-PLUGIN.md + """ + ).splitlines(keepends=True) + + diagnostics = line_linter(lines) + assert len(diagnostics) == 1 + issue = diagnostics[0] + + msg = "Missing key" + assert issue.message == msg + assert f"{issue.range}" == "3:4-3:5" + assert issue.severity == DiagnosticSeverity.Error + + @requires_levenshtein def test_debputy_lint_unknown_keys_spelling(line_linter: LintWrapper) -> None: lines = textwrap.dedent( |