mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-22 08:48:38 +00:00
Strip trailing .0 from historic EPC UPRN 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
66b776e0aa
commit
be2b71c235
1 changed files with 14 additions and 0 deletions
|
|
@ -128,3 +128,17 @@ def test_invalid_postcode_raises_postcode_not_found():
|
||||||
with patch.object(AddressMatch, "is_valid_postcode", return_value=False):
|
with patch.object(AddressMatch, "is_valid_postcode", return_value=False):
|
||||||
with pytest.raises(PostcodeNotFound):
|
with pytest.raises(PostcodeNotFound):
|
||||||
repo.get_for_postcode("NONSENSE")
|
repo.get_for_postcode("NONSENSE")
|
||||||
|
|
||||||
|
|
||||||
|
def test_uprn_trailing_dot_zero_is_stripped():
|
||||||
|
# Arrange — pandas reads an integer UPRN column as float, so the CSV cell
|
||||||
|
# arrives as "151020766.0"; the domain UPRN must be the bare integer string.
|
||||||
|
df = _df([_row("47 GORDON ROAD", "151020766.0")])
|
||||||
|
repo = HistoricEpcS3Repository(read_csv_gz=lambda bucket, key: df)
|
||||||
|
|
||||||
|
# Act
|
||||||
|
with _valid_postcode():
|
||||||
|
records = repo.get_for_postcode("AB33 8AL")
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert records[0].uprn == "151020766"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue