Enhance CSV metadata with error tracking for mosaics and tiles

This commit is contained in:
2026-04-25 16:06:54 -04:00
parent e8d3bf7180
commit ae37c06f15
10 changed files with 406 additions and 34 deletions
+36
View File
@@ -0,0 +1,36 @@
"""Tests for spruce.download_result classification."""
import requests
from spruce.download_result import (
PERMANENT_MISSING,
TRANSIENT,
UNKNOWN,
classify_http_error,
error_code_str,
)
def test_classify_404_permanent():
assert classify_http_error(404, None) == PERMANENT_MISSING
def test_classify_410_permanent():
assert classify_http_error(410, None) == PERMANENT_MISSING
def test_classify_503_transient():
assert classify_http_error(503, None) == TRANSIENT
def test_classify_timeout_transient():
assert classify_http_error(None, requests.Timeout()) == TRANSIENT
def test_classify_unknown_4xx():
assert classify_http_error(403, None) == UNKNOWN
def test_error_code_str():
assert error_code_str(None) == ""
assert error_code_str(404) == "404"