mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
additional fields mapped from pdf 6 🟩
This commit is contained in:
parent
2bf8bc6d5e
commit
146b5999dc
4 changed files with 42 additions and 0 deletions
BIN
backend/documents_parser/tests/fixtures/ExampleSiteNotes_6.pdf
vendored
Normal file
BIN
backend/documents_parser/tests/fixtures/ExampleSiteNotes_6.pdf
vendored
Normal file
Binary file not shown.
1
backend/documents_parser/tests/fixtures/site_notes_example_6_text.json
vendored
Normal file
1
backend/documents_parser/tests/fixtures/site_notes_example_6_text.json
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue