From c0423295daffb3c784026f41e629ff844f3a6fb8 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Wed, 10 Jun 2026 15:35:19 +0000 Subject: [PATCH] =?UTF-8?q?Guard=20all=201000=20RdSAP=2020.0.0=20certs=20a?= =?UTF-8?q?s=20a=20strict=20parse-and-map=20bucket=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../epc_client/tests/test_mapper_corpus.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/infrastructure/epc_client/tests/test_mapper_corpus.py b/infrastructure/epc_client/tests/test_mapper_corpus.py index ecc36725..6aaeb8de 100644 --- a/infrastructure/epc_client/tests/test_mapper_corpus.py +++ b/infrastructure/epc_client/tests/test_mapper_corpus.py @@ -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)