Skip to content

Commit 629c244

Browse files
committed
fix(tests): update EquipmentKB instantiation to use model_validate for completeness scoring
1 parent ff89bc3 commit 629c244

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

backend/tests/test_kb_schema.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,11 @@ def test_compute_completeness_p02_is_high():
214214
@pytest.mark.unit
215215
def test_compute_completeness_partial_kb():
216216
"""Partial KB with only 1 threshold and no failure patterns scores < 0.5."""
217-
kb = EquipmentKB(
218-
equipment={"manufacturer": "Grundfos"},
219-
thresholds={"vibration_mm_s": {"alert": 4.5}},
217+
kb = EquipmentKB.model_validate(
218+
{
219+
"equipment": {"manufacturer": "Grundfos"},
220+
"thresholds": {"vibration_mm_s": {"alert": 4.5}},
221+
}
220222
)
221223
score = kb.compute_completeness()
222224
# 1 threshold out of 3 expected -> 0.5 * (1/3) = ~0.167

0 commit comments

Comments
 (0)