mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
review: bind test inputs in Arrange for the wall-insulation-thickness tests
PR feedback (dancafc): the `_api_resolve_wall_insulation_thickness` tests passed literals straight into the Act call. Bind them as named variables in Arrange (`lodged_thickness`, `measured_value_mm`, `ni_lodgement`) and have the asserts reference those names, so the Act line reads declaratively and the inputs/expectations are stated once. Applied to all three tests in the class. No behaviour change; tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
86b875af35
commit
5597a8b87e
1 changed files with 21 additions and 6 deletions
|
|
@ -717,11 +717,16 @@ class TestApiResolveWallInsulationThickness:
|
||||||
_api_resolve_wall_insulation_thickness,
|
_api_resolve_wall_insulation_thickness,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
lodged_thickness = "measured"
|
||||||
|
measured_value_mm = 100
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
resolved = _api_resolve_wall_insulation_thickness("measured", 100)
|
resolved = _api_resolve_wall_insulation_thickness(
|
||||||
|
lodged_thickness, measured_value_mm
|
||||||
|
)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert resolved == 100
|
assert resolved == measured_value_mm
|
||||||
|
|
||||||
def test_non_measured_lodgement_passes_through_unchanged(self) -> None:
|
def test_non_measured_lodgement_passes_through_unchanged(self) -> None:
|
||||||
# Arrange
|
# Arrange
|
||||||
|
|
@ -729,12 +734,17 @@ class TestApiResolveWallInsulationThickness:
|
||||||
_api_resolve_wall_insulation_thickness,
|
_api_resolve_wall_insulation_thickness,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ni_lodgement = "NI"
|
||||||
|
measured_value_mm = 100
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
ni: object = _api_resolve_wall_insulation_thickness("NI", 100)
|
ni: object = _api_resolve_wall_insulation_thickness(
|
||||||
|
ni_lodgement, measured_value_mm
|
||||||
|
)
|
||||||
none_thk: object = _api_resolve_wall_insulation_thickness(None, None)
|
none_thk: object = _api_resolve_wall_insulation_thickness(None, None)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert ni == "NI"
|
assert ni == ni_lodgement
|
||||||
assert none_thk is None
|
assert none_thk is None
|
||||||
|
|
||||||
def test_measured_without_value_passes_through(self) -> None:
|
def test_measured_without_value_passes_through(self) -> None:
|
||||||
|
|
@ -743,11 +753,16 @@ class TestApiResolveWallInsulationThickness:
|
||||||
_api_resolve_wall_insulation_thickness,
|
_api_resolve_wall_insulation_thickness,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
lodged_thickness = "measured"
|
||||||
|
measured_value_mm = None
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
resolved: object = _api_resolve_wall_insulation_thickness("measured", None)
|
resolved: object = _api_resolve_wall_insulation_thickness(
|
||||||
|
lodged_thickness, measured_value_mm
|
||||||
|
)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert resolved == "measured"
|
assert resolved == lodged_thickness
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue