From a9b7b6ea80901e824fdfee8390072b75bd657c54 Mon Sep 17 00:00:00 2001 From: Duncan Dewhurst Date: Fri, 1 Sep 2023 14:07:03 +1200 Subject: [PATCH] Add test data --- test_data/all_errors.json | 99 +++++++++++++++++++++++++++++ test_data/invalid_countries.json | 41 ++++++++++++ test_data/invalid_resource_ids.json | 55 ++++++++++++++++ test_data/valid_template.json | 40 ++++++++++++ 4 files changed, 235 insertions(+) create mode 100644 test_data/all_errors.json create mode 100644 test_data/invalid_countries.json create mode 100644 test_data/invalid_resource_ids.json create mode 100644 test_data/valid_template.json diff --git a/test_data/all_errors.json b/test_data/all_errors.json new file mode 100644 index 0000000..3937b8d --- /dev/null +++ b/test_data/all_errors.json @@ -0,0 +1,99 @@ +{ + "datasets": [ + { + "title": "", + "risk_data_type": "wrong_code", + "publisher": { + "name": 1, + "url": "www.example.com" + }, + "spatial": { + "scale": "national", + "bbox": [ + 0 + ], + "centroid": [ + 0, + 0, + 0 + ], + "countries": "example" + }, + "license": "commercial", + "contact_point": { + "name": "Example contact point", + "email": "example.com" + }, + "creator": { + }, + "attributions": [], + "resources": [ + { + "id": "1", + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com", + "spatial_resolution": 0, + "authorNames": [ + "a", + "a" + ], + "temporal": { + "start": "11" + }, + "date_published": "1st Jan" + } + ], + "hazard": { + "event_sets": [ + { + "id": "1", + "hazards": [ + { + "id": "1", + "type": "coastal_flood", + "processes": [ + "coastal_flood" + ] + } + ], + "analysis_type": "deterministic", + "events": [ + { + "id": "1", + "calculation_method": "inferred", + "hazard": { + "id": "1", + "type": "coastal_flood", + "processes": [ + "coastal_flood" + ], + "occurrence": { + "probabalistic": { + "return_period": -1, + "probability": { + "value": 10, + "span": "a" + } + } + } + } + } + ] + } + ] + }, + "links": [ + { + "href": "https://raw.githubusercontent.com/GFDRR/rdl-standard/0__2__0/schema/rdls_schema.json", + "rel": "wrongrel" + }, + { + "href": "https://raw.githubusercontent.com/GFDRR/rdl-standard/0__2__0/schema/rdls_schema.json", + "rel": "describedby" + } + ] + } + ] +} diff --git a/test_data/invalid_countries.json b/test_data/invalid_countries.json new file mode 100644 index 0000000..0af6c3b --- /dev/null +++ b/test_data/invalid_countries.json @@ -0,0 +1,41 @@ +{ + "datasets": [ + { + "id": "1", + "title": "Example dataset", + "risk_data_type": "hazard", + "publisher": { + "name": "Example publisher", + "url": "https://www.example.com" + }, + "spatial": { + "scale": "national", + "countries": ["A", "B"] + }, + "license": "commercial", + "contact_point": { + "name": "Example contact point", + "email": "mail@example.com" + }, + "creator": { + "name": "Example creator", + "email": "mail@example.com" + }, + "resources": [ + { + "id": "1", + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com" + } + ], + "links": [ + { + "href": "https://raw.githubusercontent.com/GFDRR/rdl-standard/0__2__0/schema/rdls_schema.json", + "rel": "describedby" + } + ] + } + ] +} diff --git a/test_data/invalid_resource_ids.json b/test_data/invalid_resource_ids.json new file mode 100644 index 0000000..d647d4d --- /dev/null +++ b/test_data/invalid_resource_ids.json @@ -0,0 +1,55 @@ +{ + "datasets": [ + { + "id": "1", + "title": "Example dataset", + "risk_data_type": "hazard", + "publisher": { + "name": "Example publisher", + "url": "https://www.example.com" + }, + "spatial": { + "scale": "national", + "countries": [1,2,3] + }, + "license": "commercial", + "contact_point": { + "name": "Example contact point", + "email": "mail@example.com" + }, + "creator": { + "name": "Example creator", + "email": "mail@example.com" + }, + "resources": [ + { + "id": "1", + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com" + }, + { + "id": 1, + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com" + }, + { + "id": 2, + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com" + } + ], + "links": [ + { + "href": "https://raw.githubusercontent.com/GFDRR/rdl-standard/0__2__0/schema/rdls_schema.json", + "rel": "describedby" + } + ] + } + ] +} diff --git a/test_data/valid_template.json b/test_data/valid_template.json new file mode 100644 index 0000000..42da24e --- /dev/null +++ b/test_data/valid_template.json @@ -0,0 +1,40 @@ +{ + "datasets": [ + { + "id": "1", + "title": "Example dataset", + "risk_data_type": "hazard", + "publisher": { + "name": "Example publisher", + "url": "https://www.example.com" + }, + "spatial": { + "scale": "national" + }, + "license": "commercial", + "contact_point": { + "name": "Example contact point", + "email": "mail@example.com" + }, + "creator": { + "name": "Example creator", + "email": "mail@example.com" + }, + "resources": [ + { + "id": "1", + "title": "Example resource", + "description": "A resource", + "format": "geotiff", + "url": "http://www.example.com" + } + ], + "links": [ + { + "href": "https://raw.githubusercontent.com/GFDRR/rdl-standard/0__2__0/schema/rdls_schema.json", + "rel": "describedby" + } + ] + } + ] +}