Revision 456ad6c0
Added by koszko over 1 year ago
| src/test/test_hydrilla_builder.py | ||
|---|---|---|
| 148 | 148 |
'definitions': [{
|
| 149 | 149 |
'type': 'resource', |
| 150 | 150 |
'identifier': 'helloapple', |
| 151 |
'long_name': 'Hello Apple', |
|
| 151 | 152 |
'version': [2021, 11, 10], |
| 152 | 153 |
}, {
|
| 153 | 154 |
'type': 'resource', |
| 154 | 155 |
'identifier': 'hello-message', |
| 156 |
'long_name': 'Hello Message', |
|
| 155 | 157 |
'version': [2021, 11, 10], |
| 156 | 158 |
}, {
|
| 157 | 159 |
'type': 'mapping', |
| 158 | 160 |
'identifier': 'helloapple', |
| 161 |
'long_name': 'Hello Apple', |
|
| 159 | 162 |
'version': [2021, 11, 10], |
| 160 | 163 |
}] |
| 161 | 164 |
} |
| ... | ... | |
| 346 | 349 |
with open(subdir / '2021.11.10', 'rt') as file_handle: |
| 347 | 350 |
assert json.load(file_handle) == resource_json |
| 348 | 351 |
|
| 352 |
hydrilla_util.validator_for('api_resource_description-1.schema.json')\
|
|
| 353 |
.validate(resource_json) |
|
| 354 |
|
|
| 349 | 355 |
# Verify files under 'mapping/' |
| 350 | 356 |
mapping_dir = dstdir / 'mapping' |
| 351 | 357 |
assert ['helloapple'] == [path.name for path in mapping_dir.iterdir()] |
| ... | ... | |
| 356 | 362 |
with open(subdir / '2021.11.10', 'rt') as file_handle: |
| 357 | 363 |
assert json.load(file_handle) == settings.expected_mapping |
| 358 | 364 |
|
| 365 |
hydrilla_util.validator_for('api_mapping_description-1.schema.json')\
|
|
| 366 |
.validate(settings.expected_mapping) |
|
| 367 |
|
|
| 359 | 368 |
# Verify files under 'source/' |
| 360 | 369 |
source_dir = dstdir / 'source' |
| 361 | 370 |
assert {'hello.json', 'hello.zip'} == \
|
| ... | ... | |
| 377 | 386 |
with open(source_dir / 'hello.json', 'rt') as file_handle: |
| 378 | 387 |
assert json.load(file_handle) == settings.expected_source_description |
| 379 | 388 |
|
| 389 |
hydrilla_util.validator_for('api_source_description-1.schema.json')\
|
|
| 390 |
.validate(settings.expected_source_description) |
|
| 391 |
|
|
| 380 | 392 |
def modify_index_missing_file(dummy: CaseSettings, obj: dict) -> None: |
| 381 | 393 |
""" |
| 382 | 394 |
Modify index.json to expect missing report.spdx file and cause an error. |
Also available in: Unified diff
include new schemas in package and in tests