Skip to content

Commit

Permalink
Fix for empty tests.yaml and examples.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 22, 2024
1 parent 3dd1dc4 commit 8e74302
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ogc/bblocks/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def _load_examples(self):
examples = None
if self.examples_file.is_file():
examples = load_yaml(self.examples_file)
if not examples:
return None
try:
jsonschema.validate(examples, get_schema('examples'))
except Exception as e:
Expand Down Expand Up @@ -203,6 +205,8 @@ def get_extra_test_resources(self) -> Generator[dict, None, None]:
extra_tests_file = self.files_path / 'tests.yaml'
if extra_tests_file.is_file():
extra_tests: list[dict] = cast(list[dict], load_yaml(extra_tests_file))
if not extra_tests:
return
try:
jsonschema.validate(extra_tests, get_schema('extra-tests'))
except Exception as e:
Expand Down

0 comments on commit 8e74302

Please sign in to comment.