mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-07-12 13:29:08 +00:00
28 lines
No EOL
1.1 KiB
Python
28 lines
No EOL
1.1 KiB
Python
# A very simple script to read a presite note and load to a postgres database
|
|
import os
|
|
from etl.surveyedData.surveryedData import surveyedDataProcessor
|
|
from etl.db.db import get_db_session, init_db
|
|
from etl.transform.types import AssessorInfo
|
|
import pytest
|
|
from etl.jjc_invoice import work_out_total_floor_area
|
|
|
|
@pytest.fixture(scope="module")
|
|
def pre_site_note_path():
|
|
"""Fixture for the path to the example pre-site note."""
|
|
return os.path.join(os.getcwd(), "example_data", "pre_site_note.pdf")
|
|
|
|
@pytest.fixture(scope="module")
|
|
def local_survey(pre_site_note_path):
|
|
"""Fixture to create a surveyedDataProcessor instance."""
|
|
return surveyedDataProcessor("122 Fake Street", [pre_site_note_path])
|
|
|
|
def test_assessor_accreditation(local_survey):
|
|
"""Test that the assessor accreditation number is correct."""
|
|
assert local_survey.pre_site_note.assessor_information.accreditation_number == "QUID211435"
|
|
|
|
|
|
def test_floor_area_calculator(local_survey):
|
|
# Floor area is important to work out invoice, make a test to work out invoice correctly
|
|
area = work_out_total_floor_area(local_survey.pre_site_note)
|
|
assert area == ('73-97m', 91)
|
|
|