(endpoint: str, params: Dict[str, Any])
| 83 | |
| 84 | |
| 85 | def _test_mapbox_endpoint(endpoint: str, params: Dict[str, Any]) -> None: |
| 86 | response = _request_get(endpoint, params=params) |
| 87 | if response is None: |
| 88 | return |
| 89 | |
| 90 | try: |
| 91 | metadata = json.loads(response.headers.get("mapbox_metadata", "")) |
| 92 | except json.JSONDecodeError: |
| 93 | metadata = None |
| 94 | |
| 95 | print(f"Mapbox metadata: {metadata}") |
| 96 | if not metadata.get("image_available"): |
| 97 | print("No image available") |
| 98 | return |
| 99 | |
| 100 | _show_png(response.content, "Mapbox image") |
| 101 | |
| 102 | |
| 103 | def test_sentinel_current() -> None: |
no test coverage detected