@@ -451,7 +451,7 @@ def test_housing_assistance_validation_allows_observed_formula_gap(self):
451451
452452 assert result is data
453453
454- def test_housing_assistance_validation_rejects_half_reported_match (self ):
454+ def test_housing_assistance_validation_allows_observed_production_gap (self ):
455455 data = {
456456 "receives_housing_assistance" : {2024 : np .array ([True ])},
457457 "takes_up_housing_assistance_if_eligible" : {2024 : np .array ([True ])},
@@ -463,6 +463,26 @@ def test_housing_assistance_validation_rejects_half_reported_match(self):
463463 "spm_unit_weight" : np .array ([1.0 ]),
464464 }
465465
466+ result = ExtendedCPS ._validate_housing_assistance_microsimulation (
467+ data ,
468+ 2024 ,
469+ microsimulation_cls = _FakeHousingMicrosimulation ,
470+ )
471+
472+ assert result is data
473+
474+ def test_housing_assistance_validation_rejects_clear_benchmark_gap (self ):
475+ data = {
476+ "receives_housing_assistance" : {2024 : np .array ([True ])},
477+ "takes_up_housing_assistance_if_eligible" : {2024 : np .array ([True ])},
478+ "spm_unit_capped_housing_subsidy" : {2024 : np .array ([100.0 ])},
479+ }
480+ _FakeHousingMicrosimulation .outputs = {
481+ "housing_assistance" : np .array ([100.0 ]),
482+ "spm_unit_capped_housing_subsidy" : np .array ([44.0 ]),
483+ "spm_unit_weight" : np .array ([1.0 ]),
484+ }
485+
466486 with pytest .raises (RuntimeError , match = "implausibly small" ):
467487 ExtendedCPS ._validate_housing_assistance_microsimulation (
468488 data ,
0 commit comments