feat(grunnlag): the approved EEA assessment as a fixed table, and M7 rejects a net present value that is not a number (clarifications 136 and 139)

fra_frys takes the assessment of clarification 136 («usikker» for all
four ownership forms) and has no guard any more; it is still not called
before part 6. beste_per_trekning raises on NaN, where the best would
depend on the order of the solutions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-14 06:43:45 +01:00
commit 6a51c4f4d2
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
6 changed files with 75 additions and 37 deletions

View file

@ -390,18 +390,21 @@ def test_inngangsfila_leses_strengt_og_stanser_foer_noe_regnes(
assert not ut.exists()
def test_frysen_stanser_ved_vakten(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
"""Clarification 127: until the EEA assessment is written down, --frys stops at once."""
sti = _skriv_inngang(tmp_path, {"navn": "x"})
for argumenter in (
["scenario", sti, "--frys", "--ut", str(tmp_path / "ut")],
["hovedkjoring", "--frys", "--ut", str(tmp_path / "ut")],
):
assert vt.main(argumenter) == 2
assert (
"EØS-vurderingen per eierform er ikke fastsatt (avklaring 127)"
in capsys.readouterr().err
)
def test_frysen_henter_grunnlaget_fra_frysen(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
) -> None:
"""--frys asks for the basis from the freeze; the freeze itself is not read before part 6."""
kalt: list[tuple[object, ...]] = []
def fra_frys(*args: object) -> gl.Grunnlag:
kalt.append(args)
msg = "ikke lest i testen"
raise gl.GrunnlagError(msg)
monkeypatch.setattr(gl, "fra_frys", fra_frys)
assert vt.main(["hovedkjoring", "--frys", "--ut", str(tmp_path / "ut")]) == 2
assert "ikke lest i testen" in capsys.readouterr().err
assert kalt == [()]
assert not (tmp_path / "ut").exists()