From 73a443f518be29a50981e7e137e2b4c2c37552dd Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 31 May 2022 16:52:14 +0200 Subject: improve loading of schema files --- tests/test_build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_build.py b/tests/test_build.py index c2d8ced..7fedbd5 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -20,7 +20,7 @@ from contextlib import contextmanager from jsonschema import ValidationError from hydrilla import util as hydrilla_util -from hydrilla.util._util import _major_version_re +from hydrilla.util._util import _schema_name_re from hydrilla.builder import build, _version, local_apt from hydrilla.builder.common_errors import * @@ -595,7 +595,7 @@ def try_validate(as_what, instance): Select the right JSON schema. Return without errors only if the instance validates against it. """ - major = _major_version_re.search(instance['$schema']).group('major') + major = _schema_name_re.search(instance['$schema']).group('major') exact_schema_version = {'1': '1.0.1', '2': '2'}[major] schema_filename = f'{as_what}-{exact_schema_version}.schema.json' hydrilla_util.validator_for(schema_filename).validate(instance) -- cgit v1.2.3