aboutsummaryrefslogtreecommitdiff
path: root/tests/test_build.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-05-31 16:52:14 +0200
committerWojtek Kosior <koszko@koszko.org>2022-05-31 16:52:14 +0200
commit73a443f518be29a50981e7e137e2b4c2c37552dd (patch)
tree31388ae094278b7284c825a940ab57b5113077be /tests/test_build.py
parent2a22a0c8bb692647798ca3874b1c08533307ed96 (diff)
downloadhydrilla-builder-73a443f518be29a50981e7e137e2b4c2c37552dd.tar.gz
hydrilla-builder-73a443f518be29a50981e7e137e2b4c2c37552dd.zip
improve loading of schema files
Diffstat (limited to 'tests/test_build.py')
-rw-r--r--tests/test_build.py4
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)