summaryrefslogtreecommitdiffstats
path: root/tests/generator/test_schema.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:55:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:55:48 +0000
commit8be448d3881909fb0ce4b033cad71aa7575de0aa (patch)
treeda33caff06645347a08c3c9c56dd703e4acb5aa3 /tests/generator/test_schema.py
parentInitial commit. (diff)
downloadlsprotocol-8be448d3881909fb0ce4b033cad71aa7575de0aa.tar.xz
lsprotocol-8be448d3881909fb0ce4b033cad71aa7575de0aa.zip
Adding upstream version 2023.0.0.upstream/2023.0.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/generator/test_schema.py')
-rw-r--r--tests/generator/test_schema.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/generator/test_schema.py b/tests/generator/test_schema.py
new file mode 100644
index 0000000..dc24550
--- /dev/null
+++ b/tests/generator/test_schema.py
@@ -0,0 +1,17 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License.
+
+import json
+import pathlib
+
+import jsonschema
+
+lsp_json_path = pathlib.Path(__file__).parent.parent.parent / "generator" / "lsp.json"
+lsp_schema_path = lsp_json_path.parent / "lsp.schema.json"
+
+
+def test_validate_with_schema():
+ model = json.loads((lsp_json_path).read_text(encoding="utf-8"))
+ schema = json.loads((lsp_schema_path).read_text(encoding="utf-8"))
+
+ jsonschema.validate(model, schema)