additional fields mapped from pdf 6 🟩

This commit is contained in:
Daniel Roth 2026-04-23 11:23:29 +00:00
parent 2bf8bc6d5e
commit 146b5999dc
4 changed files with 42 additions and 0 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -372,3 +372,25 @@ class TestPdfToEpcPropertyDataFixture5:
result.sap_heating.shower_outlets.shower_outlet.shower_outlet_type
== "Electric Shower"
)
PDF_PATH_6 = os.path.join(
os.path.dirname(__file__), "fixtures", "ExampleSiteNotes_6.pdf"
)
class TestPdfToEpcPropertyDataFixture6:
@pytest.fixture
def result(self) -> EpcPropertyData:
with open(PDF_PATH_6, "rb") as f:
pdf_bytes = f.read()
site_notes = PasHubRdSapSiteNotesExtractor(
pdf_to_text_list(pdf_bytes)
).extract()
return EpcPropertyDataMapper.from_site_notes(site_notes)
def test_party_wall_construction(self, result: EpcPropertyData) -> None:
assert (
result.sap_building_parts[0].party_wall_construction
== "Solid Masonry, Timber Frame, or System Built"
)

View file

@ -61,6 +61,11 @@ def load_text_fixture_5() -> list[str]:
return json.load(f)
def load_text_fixture_6() -> list[str]:
with open(os.path.join(FIXTURES, "site_notes_example_6_text.json")) as f:
return json.load(f)
class TestInspectionMetadata:
def test_full_inspection_metadata(self) -> None:
result = PasHubRdSapSiteNotesExtractor(load_text_fixture()).extract_inspection_metadata()
@ -778,3 +783,17 @@ class TestElectricShowerExtraction:
def test_shower_outlet_type(self, wu: WaterUse) -> None:
assert wu.showers[0].outlet_type == "Electric Shower"
class TestSolidMasonryPartyWall:
@pytest.fixture
def bc(self) -> BuildingConstruction:
return PasHubRdSapSiteNotesExtractor(
load_text_fixture_6()
).extract_building_construction()
def test_party_wall_construction_type(self, bc: BuildingConstruction) -> None:
assert (
bc.main_building.party_wall_construction_type
== "Solid Masonry, Timber Frame, or System Built"
)