Skip to content

Commit b5a2951

Browse files
committed
Fix test reports not being written
1 parent 242a321 commit b5a2951

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

ogc/bblocks/validate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _validate_resource(bblock: BuildingBlock,
185185
base_uri=base_uri,
186186
additional_shacl_closures=additional_shacl_closures,
187187
schema_ref=schema_ref)
188-
any_validator_run = any_validator_run or (result is not None)
188+
any_validator_run = any_validator_run or (result is not False)
189189

190190
except Exception as unknown_exc:
191191
report.add_entry(ValidationReportEntry(

ogc/bblocks/validation/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def validate(self, filename: Path, output_filename: Path,
2323
base_uri: str | None = None,
2424
resource_url: str | None = None,
2525
require_fail: bool | None = None,
26-
**kwargs) -> ValidationReportItem | None:
26+
**kwargs) -> bool | None:
2727
raise NotImplementedError
2828

2929

ogc/bblocks/validation/json_.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ def __init__(self, bblock: BuildingBlock, register: BuildingBlockRegister):
8888
def validate(self, filename: Path, output_filename: Path, report: ValidationReportItem,
8989
contents: str | None = None,
9090
schema_ref: str | None = None,
91-
**kwargs) -> ValidationReportItem | None:
91+
**kwargs) -> bool | None:
9292

9393
if filename.suffix not in ('.json', '.jsonld', '.yaml', '.yml'):
94-
return
94+
return False
9595

9696
file_from = 'examples' if report.source.type == ValidationItemSourceType.EXAMPLE else 'test resources'
9797

@@ -232,5 +232,3 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
232232
'col': e.colno,
233233
}
234234
))
235-
236-
return report

ogc/bblocks/validation/rdf.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
269269
contents: str | None = None,
270270
base_uri: str | None = None,
271271
additional_shacl_closures: list[str | Path] | None = None,
272-
**kwargs) -> ValidationReportItem | None:
272+
**kwargs) -> bool | None:
273273
graph = self._load_graph(filename, output_filename, report, contents, base_uri)
274274

275275
if graph is None:
276-
return
276+
return False
277277

278278
if graph is not None and (contents or filename.suffix != '.ttl'):
279279
try:
@@ -418,5 +418,3 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
418418
'shaclFile': str(shacl_file),
419419
}
420420
))
421-
422-
return report

0 commit comments

Comments
 (0)