|
79 | 79 | "../..",
|
80 | 80 | "/..",
|
81 | 81 | "../",
|
82 |
| - "1984-04-12T23:20:50.52Z/1985-04-12T23:20:50.52Z", |
| 82 | + "/1984-04-12T23:20:50.52Z/1985-04-12T23:20:50.52Z", |
83 | 83 | "1984-04-12T23:20:50.52Z/1985-04-12T23:20:50.52Z/",
|
84 | 84 | "/1984-04-12T23:20:50.52Z/1985-04-12T23:20:50.52Z/",
|
85 | 85 | "1985-04-12", # date only
|
@@ -211,15 +211,13 @@ def validate_core(root_body: Dict, warnings: List[str], errors: List[str]) -> No
|
211 | 211 | )
|
212 | 212 |
|
213 | 213 | service_desc_type = service_desc.get("type")
|
214 |
| - if (ct := r_service_desc.headers.get("content-type")) == service_desc_type: |
215 |
| - pass |
216 |
| - elif (";" in ct or ";" in service_desc_type) and ( |
217 |
| - ct.split(";", 1)[0] == service_desc_type.split(";", 1)[0] |
| 214 | + if ( |
| 215 | + (ct := r_service_desc.headers.get("content-type")) == service_desc_type |
| 216 | + ) or ( |
| 217 | + (";" in ct or ";" in service_desc_type) |
| 218 | + and (ct.split(";", 1)[0] == service_desc_type.split(";", 1)[0]) |
218 | 219 | ):
|
219 |
| - warnings.append( |
220 |
| - f"service-desc ({service_desc}): link must advertise same type as endpoint content-type header, " |
221 |
| - f"advertised '{service_desc_type}', actually '{ct}'" |
222 |
| - ) |
| 220 | + pass |
223 | 221 | else:
|
224 | 222 | errors.append(
|
225 | 223 | f"service-desc ({service_desc}): link must advertise same type as endpoint content-type header, "
|
@@ -357,38 +355,40 @@ def validate_search_datetime(search_url: str, warnings: List[str], errors: List[
|
357 | 355 | r = requests.get(search_url, params={"datetime": dt})
|
358 | 356 | if r.status_code != 200:
|
359 | 357 | errors.append(
|
360 |
| - f"Search with datetime={dt} extracted from an Item returned status code {r.status_code}" |
| 358 | + f"GET Search with datetime={dt} extracted from an Item returned status code {r.status_code}" |
361 | 359 | )
|
362 | 360 | elif len(r.json()["features"]) == 0:
|
363 | 361 | errors.append(
|
364 |
| - f"Search with datetime={dt} extracted from an Item returned no results." |
| 362 | + f"GET Search with datetime={dt} extracted from an Item returned no results." |
365 | 363 | )
|
366 | 364 |
|
367 | 365 | for dt in valid_datetimes:
|
368 | 366 | r = requests.get(search_url, params={"datetime": dt})
|
369 | 367 | if r.status_code != 200:
|
370 | 368 | errors.append(
|
371 |
| - f"Search with datetime={dt} returned status code {r.status_code}" |
| 369 | + f"GET Search with datetime={dt} returned status code {r.status_code}" |
372 | 370 | )
|
373 | 371 | continue
|
374 | 372 | try:
|
375 | 373 | r.json()
|
376 | 374 | except json.decoder.JSONDecodeError:
|
377 |
| - errors.append(f"Search with datetime={dt} returned non-json response") |
| 375 | + errors.append(f"GET Search with datetime={dt} returned non-json response") |
378 | 376 |
|
379 | 377 | for dt in invalid_datetimes:
|
380 | 378 | r = requests.get(search_url, params={"datetime": dt})
|
381 | 379 | if r.status_code == 200:
|
382 | 380 | warnings.append(
|
383 |
| - f"Search with datetime={dt} returned status code 200 instead of 400" |
| 381 | + f"GET Search with datetime={dt} returned status code 200 instead of 400" |
384 | 382 | )
|
385 | 383 | continue
|
386 | 384 | if r.status_code != 400:
|
387 | 385 | errors.append(
|
388 |
| - f"Search with datetime={dt} returned status code {r.status_code} instead of 400" |
| 386 | + f"GET Search with datetime={dt} returned status code {r.status_code} instead of 400" |
389 | 387 | )
|
390 | 388 | continue
|
391 | 389 |
|
| 390 | + # todo: POST |
| 391 | + |
392 | 392 |
|
393 | 393 | def validate_search_bbox_xor_intersects(search_url: str, post: bool, errors: List[str]):
|
394 | 394 | r = requests.get(
|
|
0 commit comments