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