mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Resolve an address to its unambiguous historic EPC UPRN 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a30ab59f3c
commit
b8c376bfd6
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue