From 456ad6c0760329943f4f8e2b2b7dc0e260cba128 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 9 Feb 2022 14:41:05 +0100 Subject: include new schemas in package and in tests --- src/hydrilla/builder/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/hydrilla/builder/build.py') diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py index dae5579..3503f7a 100644 --- a/src/hydrilla/builder/build.py +++ b/src/hydrilla/builder/build.py @@ -35,7 +35,7 @@ import jsonschema from .. import util -index_json_schema = util.load_schema('package_source-1.schema.json') +index_validator = util.validator_for('package_source-1.schema.json') class FileReferenceError(Exception): """ @@ -275,8 +275,8 @@ class Build: item_list.append(new_item_obj) - return dict([(prop, new_item_obj[prop]) - for prop in ('type', 'identifier', 'version')]) + props_in_ref = ('type', 'identifier', 'version', 'long_name') + return dict([(prop, new_item_obj[prop]) for prop in props_in_ref]) def _process_index_json(self, index_obj: dict): """ @@ -285,7 +285,7 @@ class Build: files and computed definitions of the source package and items defined in it. """ - jsonschema.validate(index_obj, index_json_schema) + index_validator.validate(index_obj) self.source_name = index_obj['source_name'] -- cgit v1.2.3