summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests/test_lint_debputy.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:43:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:43:21 +0000
commitf444a9b5ce73bb79e9f7cd1866f1b2b479023333 (patch)
treef11e47bb5d9c26cd773fde6406a418a70ef1bdfb /tests/lint_tests/test_lint_debputy.py
parentAdding upstream version 0.1.34. (diff)
downloaddebputy-f444a9b5ce73bb79e9f7cd1866f1b2b479023333.tar.xz
debputy-f444a9b5ce73bb79e9f7cd1866f1b2b479023333.zip
Adding upstream version 0.1.35.upstream/0.1.35
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lint_tests/test_lint_debputy.py')
-rw-r--r--tests/lint_tests/test_lint_debputy.py23
1 files changed, 23 insertions, 0 deletions
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(