mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
include address and postcode on magicplan plan 🟥
This commit is contained in:
parent
da6b04878e
commit
3b9d40f2f8
2 changed files with 136780 additions and 0 deletions
136742
backend/magic_plan/magicplan_api_plan_response_example_3.json
Normal file
136742
backend/magic_plan/magicplan_api_plan_response_example_3.json
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -172,3 +172,41 @@ def test_plan2_window_opening_type_hung(plan2: Plan):
|
||||||
def test_plan2_door_width_rounded_to_2dp(plan2: Plan):
|
def test_plan2_door_width_rounded_to_2dp(plan2: Plan):
|
||||||
door = plan2.floors[0].rooms[0].doors[0]
|
door = plan2.floors[0].rooms[0].doors[0]
|
||||||
assert door.width_mm == 0.71
|
assert door.width_mm == 0.71
|
||||||
|
|
||||||
|
|
||||||
|
# --- Address and postcode fields ---
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan_postcode(plan: Plan):
|
||||||
|
assert plan.postcode == "BR2 8BZ"
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan_address(plan: Plan):
|
||||||
|
assert plan.address == "2 Laburnum Way, Bromley, GB"
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan2_postcode(plan2: Plan):
|
||||||
|
assert plan2.postcode == "BR1 3LP"
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan2_address(plan2: Plan):
|
||||||
|
assert plan2.address == "11 Station Road, Bromley, GB"
|
||||||
|
|
||||||
|
|
||||||
|
# --- Fixture 3: street_number set, city absent ---
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module")
|
||||||
|
def plan3() -> Plan:
|
||||||
|
payload = json.loads(
|
||||||
|
(FIXTURE_DIR / "magicplan_api_plan_response_example_3.json").read_text()
|
||||||
|
)
|
||||||
|
return map_plan(MagicPlan.model_validate(payload["data"]))
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan3_address_uses_street_number_and_omits_city(plan3: Plan):
|
||||||
|
assert plan3.address == "2 Laburnum Way, GB"
|
||||||
|
|
||||||
|
|
||||||
|
def test_plan3_postcode(plan3: Plan):
|
||||||
|
assert plan3.postcode == "BR2 8BZ"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue