diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-02-09 14:41:05 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-02-09 14:41:05 +0100 |
commit | 456ad6c0760329943f4f8e2b2b7dc0e260cba128 (patch) | |
tree | 8a2310e8e9c7e515284c4f29169602482be870a6 /src/test | |
parent | 8c65ebbddf7a3929b82848efa8f404d8ea56200a (diff) | |
download | hydrilla-builder-456ad6c0760329943f4f8e2b2b7dc0e260cba128.tar.gz hydrilla-builder-456ad6c0760329943f4f8e2b2b7dc0e260cba128.zip |
include new schemas in package and in tests
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_hydrilla_builder.py | 12 |
1 files changed, 12 insertions, 0 deletions
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. |