From b8c376bfd6e8010b5165121a3ce1a6e43a0c85c2 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 29 Jun 2026 14:52:06 +0000 Subject: [PATCH] =?UTF-8?q?Resolve=20an=20address=20to=20its=20unambiguous?= =?UTF-8?q?=20historic=20EPC=20UPRN=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../test_historic_epc_resolver.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/repositories/historic_epc/test_historic_epc_resolver.py b/tests/repositories/historic_epc/test_historic_epc_resolver.py index a22c14b8d..aa4307276 100644 --- a/tests/repositories/historic_epc/test_historic_epc_resolver.py +++ b/tests/repositories/historic_epc/test_historic_epc_resolver.py @@ -51,3 +51,26 @@ def test_match_composes_repo_and_matcher_into_scored_matches(): assert result.postcode == "AB338AL" assert len(result.matches) == 2 assert result.top().record.address == "47 GORDON ROAD" + + +def test_resolve_uprn_returns_unambiguous_match(): + # Arrange + repo = _FakeRepo( + { + "AB338AL": [ + _hist("47 GORDON ROAD", "100"), + _hist("48 GORDON ROAD", "200"), + ] + } + ) + resolver = HistoricEpcResolver(repo) + + # Act + result = resolver.resolve_uprn("47 Gordon Road", "AB33 8AL") + + # Assert + assert result is not None + uprn, address, score = result + assert uprn == "100" + assert address == "47 GORDON ROAD" + assert score > 0