diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-05-31 16:52:14 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-05-31 16:52:14 +0200 |
commit | 73a443f518be29a50981e7e137e2b4c2c37552dd (patch) | |
tree | 31388ae094278b7284c825a940ab57b5113077be /tests | |
parent | 2a22a0c8bb692647798ca3874b1c08533307ed96 (diff) | |
download | hydrilla-builder-73a443f518be29a50981e7e137e2b4c2c37552dd.tar.gz hydrilla-builder-73a443f518be29a50981e7e137e2b4c2c37552dd.zip |
improve loading of schema files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_build.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |