Revision 9271ca7b
Added by koszko over 1 year ago
src/test/test_hydrilla_builder.py | ||
---|---|---|
65 | 65 |
self.contents = default_contents.copy() |
66 | 66 |
|
67 | 67 |
self.expected_resources = [{ |
68 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json', |
|
68 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.0.1.schema.json',
|
|
69 | 69 |
'source_name': 'hello', |
70 | 70 |
'source_copyright': [{ |
71 | 71 |
'file': 'report.spdx', |
... | ... | |
91 | 91 |
}], |
92 | 92 |
'generated_by': expected_generated_by |
93 | 93 |
}, { |
94 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json', |
|
94 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_resource_description-1.0.1.schema.json',
|
|
95 | 95 |
'source_name': 'hello', |
96 | 96 |
'source_copyright': [{ |
97 | 97 |
'file': 'report.spdx', |
... | ... | |
115 | 115 |
'generated_by': expected_generated_by |
116 | 116 |
}] |
117 | 117 |
self.expected_mapping = { |
118 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_mapping_description-1.schema.json', |
|
118 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_mapping_description-1.0.1.schema.json',
|
|
119 | 119 |
'source_name': 'hello', |
120 | 120 |
'source_copyright': [{ |
121 | 121 |
'file': 'report.spdx', |
... | ... | |
141 | 141 |
'generated_by': expected_generated_by |
142 | 142 |
} |
143 | 143 |
self.expected_source_description = { |
144 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_source_description-1.schema.json', |
|
144 |
'$schema': 'https://hydrilla.koszko.org/schemas/api_source_description-1.0.1.schema.json',
|
|
145 | 145 |
'source_name': 'hello', |
146 | 146 |
'source_copyright': [{ |
147 | 147 |
'file': 'report.spdx', |
... | ... | |
367 | 367 |
with open(subdir / '2021.11.10', 'rt') as file_handle: |
368 | 368 |
assert json.load(file_handle) == resource_json |
369 | 369 |
|
370 |
hydrilla_util.validator_for('api_resource_description-1.schema.json')\ |
|
370 |
hydrilla_util.validator_for('api_resource_description-1.0.1.schema.json')\
|
|
371 | 371 |
.validate(resource_json) |
372 | 372 |
|
373 | 373 |
# Verify files under 'mapping/' |
... | ... | |
380 | 380 |
with open(subdir / '2021.11.10', 'rt') as file_handle: |
381 | 381 |
assert json.load(file_handle) == settings.expected_mapping |
382 | 382 |
|
383 |
hydrilla_util.validator_for('api_mapping_description-1.schema.json')\ |
|
383 |
hydrilla_util.validator_for('api_mapping_description-1.0.1.schema.json')\
|
|
384 | 384 |
.validate(settings.expected_mapping) |
385 | 385 |
|
386 | 386 |
# Verify files under 'source/' |
... | ... | |
404 | 404 |
with open(source_dir / 'hello.json', 'rt') as file_handle: |
405 | 405 |
assert json.load(file_handle) == settings.expected_source_description |
406 | 406 |
|
407 |
hydrilla_util.validator_for('api_source_description-1.schema.json')\ |
|
407 |
hydrilla_util.validator_for('api_source_description-1.0.1.schema.json')\
|
|
408 | 408 |
.validate(settings.expected_source_description) |
409 | 409 |
|
410 | 410 |
def modify_index_missing_file(dummy: CaseSettings, obj: dict) -> None: |
Also available in: Unified diff
update schema versions to 1.0.1