Skip to content

Commit d9abb82

Browse files
committed
check_isa_schemas updated to new json validator. #591
1 parent 5cf4ae3 commit d9abb82

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

isatools/isajson/validate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import re
1515
from io import StringIO
1616

17-
from jsonschema import Draft4Validator, RefResolver, ValidationError
17+
from jsonschema import Draft4Validator, ValidationError
1818

1919
from isatools.isajson.load import load
2020

@@ -548,9 +548,9 @@ def check_isa_schemas(isa_json, investigation_schema_path):
548548
try:
549549
with open(investigation_schema_path) as fp:
550550
investigation_schema = json.load(fp)
551-
resolver = RefResolver("file://" + investigation_schema_path, investigation_schema)
552-
validator = Draft4Validator(investigation_schema, resolver=resolver)
551+
validator = Draft4Validator(investigation_schema)
553552
validator.validate(isa_json)
553+
#jsonschema.validate(instance=isa_json, schema=investigation_schema, cls=jsonschema.Draft4Validator)
554554
except ValidationError as ve:
555555
errors.append({"message": "Invalid JSON against ISA-JSON schemas", "supplemental": str(ve), "code": 3})
556556
log.fatal("(F) The JSON does not validate against the provided ISA-JSON schemas!")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dependencies = [
5757
"graphene~=3.4.3",
5858
"graphql-core~=3.2.6",
5959
"ruff>=0.14.1",
60+
"pytest-timeout>=2.4.0",
6061
]
6162

6263
[project.optional-dependencies]

tests/validators/test_validators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ def test_info_reporting_mtbls1_isatab(self):
484484
report = isatab.validate(
485485
fp=test_case_fp, config_dir=utils.DEFAULT2015_XML_CONFIGS_DATA_DIR, log_level=self._reporting_level
486486
)
487-
print(report)
488487
# self.assertIn(
489488
# {'supplemental': 'Found 4 study groups in s_MTBLS1.txt',
490489
# 'code': 5001,

uv.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)