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/test/test_hydrilla_builder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/test') diff --git a/src/test/test_hydrilla_builder.py b/src/test/test_hydrilla_builder.py index 605dc31..0b6244f 100644 --- a/src/test/test_hydrilla_builder.py +++ b/src/test/test_hydrilla_builder.py @@ -148,14 +148,17 @@ class CaseSettings: 'definitions': [{ 'type': 'resource', 'identifier': 'helloapple', + 'long_name': 'Hello Apple', 'version': [2021, 11, 10], }, { 'type': 'resource', 'identifier': 'hello-message', + 'long_name': 'Hello Message', 'version': [2021, 11, 10], }, { 'type': 'mapping', 'identifier': 'helloapple', + 'long_name': 'Hello Apple', 'version': [2021, 11, 10], }] } @@ -346,6 +349,9 @@ def test_build(tmpdir, prepare_source_example): with open(subdir / '2021.11.10', 'rt') as file_handle: assert json.load(file_handle) == resource_json + hydrilla_util.validator_for('api_resource_description-1.schema.json')\ + .validate(resource_json) + # Verify files under 'mapping/' mapping_dir = dstdir / 'mapping' assert ['helloapple'] == [path.name for path in mapping_dir.iterdir()] @@ -356,6 +362,9 @@ def test_build(tmpdir, prepare_source_example): with open(subdir / '2021.11.10', 'rt') as file_handle: assert json.load(file_handle) == settings.expected_mapping + hydrilla_util.validator_for('api_mapping_description-1.schema.json')\ + .validate(settings.expected_mapping) + # Verify files under 'source/' source_dir = dstdir / 'source' assert {'hello.json', 'hello.zip'} == \ @@ -377,6 +386,9 @@ def test_build(tmpdir, prepare_source_example): with open(source_dir / 'hello.json', 'rt') as file_handle: assert json.load(file_handle) == settings.expected_source_description + hydrilla_util.validator_for('api_source_description-1.schema.json')\ + .validate(settings.expected_source_description) + def modify_index_missing_file(dummy: CaseSettings, obj: dict) -> None: """ Modify index.json to expect missing report.spdx file and cause an error. -- cgit v1.2.3