summaryrefslogtreecommitdiffstats
path: root/tests/lsp_tests
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/lsp_tests
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/lsp_tests')
-rw-r--r--tests/lsp_tests/test_lsp_debputy_manifest_completer.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
index 196df2e..dab26d3 100644
--- a/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
+++ b/tests/lsp_tests/test_lsp_debputy_manifest_completer.py
@@ -597,3 +597,52 @@ def test_basic_debputy_completer_manifest_conditions(
assert "not:" in keywords
# str-only forms are not applicable here
assert "cross-compiling" not in keywords
+
+
+def test_basic_debputy_completer_mid_doc(ls: "DebputyLanguageServer") -> None:
+ debputy_manifest_uri = "file:///nowhere/debian/debputy.manifest"
+ cursor_pos = put_doc_with_cursor(
+ ls,
+ debputy_manifest_uri,
+ "debian/debputy.manifest",
+ textwrap.dedent(
+ """\
+ manifest-version: 0.1
+ installations:
+ - install-docs:
+ s<CURSOR>
+ - foo
+"""
+ ),
+ )
+
+ completions = debputy_manifest_completer(
+ ls,
+ CompletionParams(TextDocumentIdentifier(debputy_manifest_uri), cursor_pos),
+ )
+ assert isinstance(completions, list)
+ keywords = {m.label for m in completions}
+ assert "sources:" in keywords
+
+ cursor_pos = put_doc_with_cursor(
+ ls,
+ debputy_manifest_uri,
+ "debian/debputy.manifest",
+ textwrap.dedent(
+ """\
+ manifest-version: 0.1
+ installations:
+ - install-docs:
+ s<CURSOR>:
+ - foo
+"""
+ ),
+ )
+
+ completions = debputy_manifest_completer(
+ ls,
+ CompletionParams(TextDocumentIdentifier(debputy_manifest_uri), cursor_pos),
+ )
+ assert isinstance(completions, list)
+ keywords = {m.label for m in completions}
+ assert "sources" in keywords