-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26a7d33
commit d529e0d
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from probeinterface import __version__ as version | ||
import jsonschema | ||
|
||
json_schema_file = Path(__file__).absolute().parent.parent.parent / "resources" / "probe.json.schema" | ||
schema = json.load(open(json_schema_file, "r")) | ||
|
||
def validate_probe_dict(probe_dict): | ||
instance = dict(specification="probeinterface", version=version, probes=[probe_dict]) | ||
jsonschema.validate(instance=instance, schema=schema) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters