summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lint_tests')
-rw-r--r--tests/lint_tests/test_lint_dctrl.py38
-rw-r--r--tests/lint_tests/test_lint_debputy.py23
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(