Classify the landlord Main Fuel column into a fuel category 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-19 12:43:54 +00:00
parent 3dab6fc425
commit 04dd2dd222
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,27 @@
"""The landlord-description-overrides handler's column wiring (`_build_columns`).
A `column_mapping` entry of ``{category -> source header}`` must produce a
ClassifiableColumn that reads the named header and classifies into the
category's enum. This pins the main_fuel category onto the wiring.
"""
from __future__ import annotations
from typing import cast
from applications.landlord_description_overrides.handler import _build_columns
from infrastructure.chatgpt.chatgpt import ChatGPT
def test_build_columns_wires_a_main_fuel_classifier_column() -> None:
# Arrange — the factory only stores the injected collaborators, so a bare
# object stands in for the (I/O-bound) ChatGPT client and the DB session.
chat_gpt = cast(ChatGPT, object())
# Act
columns = _build_columns({"main_fuel": "Main Fuel"}, chat_gpt, None)
# Assert — one column, named main_fuel, reading the "Main Fuel" header.
assert len(columns) == 1
assert columns[0].name == "main_fuel"
assert columns[0].source_column == "Main Fuel"