Guard all 1000 RdSAP 20.0.0 certs as a strict parse-and-map bucket 🟩

Drops the xfail now that Reduced-Field Synthesis (ADR-0027) maps every
20.0.0 cert; the corpus test holds the whole bucket to a strict 1000/1000.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-10 15:35:19 +00:00
parent c0b8a7d9f8
commit c0423295da

View file

@ -6,10 +6,9 @@ scripts/eon/harvest_certs.py. Each line is one cert in the exact shape
``from_api_response`` consumes.
* 21.0.0 / 21.0.1 supported today; these are a regression guard.
* 20.0.0 mapper is incomplete, so these are xfail. As
``from_rdsap_schema_20_0_0`` is built out they flip to
xpass; when the whole bucket passes, drop the xfail
marker and the strict guard below will keep it honest.
* 20.0.0 pre-SAP10 Reduced-Field Synthesis (ADR-0027). All 1000
certs now parse and map, so the xfail is dropped and the
strict guard below keeps the whole bucket honest.
If the corpus hasn't been harvested yet, every parametrisation is skipped.
"""
@ -26,8 +25,7 @@ from datatypes.epc.domain.epc_property_data import EpcPropertyData
from datatypes.epc.domain.mapper import EpcPropertyDataMapper
SAMPLES = Path("backend/epc_api/json_samples")
SUPPORTED = {"RdSAP-Schema-21.0.1"}
WIP = {"RdSAP-Schema-20.0.0"}
SUPPORTED = {"RdSAP-Schema-21.0.1", "RdSAP-Schema-20.0.0"}
def _load(schema: str) -> list[dict[str, Any]]:
@ -59,10 +57,3 @@ def _cases(schemas: set[str]) -> list[Any]:
def test_supported_schemas_map(cert: dict[str, Any]) -> None:
result = EpcPropertyDataMapper.from_api_response(cert)
assert isinstance(result, EpcPropertyData)
@pytest.mark.xfail(reason="RdSapSchema20.0.0 mapper is incomplete", strict=False)
@pytest.mark.parametrize("cert", _cases(WIP))
def test_wip_schema_20_maps(cert: dict[str, Any]) -> None:
result = EpcPropertyDataMapper.from_api_response(cert)
assert isinstance(result, EpcPropertyData)