diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:55:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:55:48 +0000 |
commit | 8be448d3881909fb0ce4b033cad71aa7575de0aa (patch) | |
tree | da33caff06645347a08c3c9c56dd703e4acb5aa3 /tests/generator/test_schema.py | |
parent | Initial commit. (diff) | |
download | lsprotocol-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.py | 17 |
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) |