fix: findings from the Cowork test, released as v0.1.1
The operator tested v0.1.0 in Cowork on 2026-11-11. README now says what was measured there and what was not. - miljo: no longer claims that kontroll compares "with tolerance, not bit for bit" when numpy or scipy differ from the note's versions. kontroll always compares byte for byte first, and numpy 2.5.3 gave bit for bit. - kontroll --alt: show every differing line. The cut-off line now names the option instead of only counting the lines left out. - skill simuler: the question before a run must be answerable with yes or no. In the test it became a choice between variants and the run stalled. - skill forbedre: offer the working copy as a zip when the user cannot open the folder it was made in, as in Cowork. 263 tests pass; full kontroll: bit for bit with the note. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
19858bbda9
commit
13f6c28dc0
11 changed files with 126 additions and 29 deletions
|
|
@ -345,7 +345,12 @@ def test_opprett_faller_tilbake_og_sier_toleranse(
|
|||
monkeypatch.setattr(kjor_modul, "rapport_miljo", lambda _valg: None)
|
||||
assert kjor_modul.main(["--data", str(tmp_path), "miljo", "--opprett"]) == 0
|
||||
assert [k[-2:] for k in kommandoer] == [["-r", str(MODELL / "requirements.txt")], ["numpy>=2.0", "scipy"]]
|
||||
assert "kontrolleres da med toleranse, ikke bit for bit" in capsys.readouterr().out
|
||||
ut = capsys.readouterr().out
|
||||
assert "lot seg ikke installere, så nyere versjoner er installert" in ut
|
||||
assert "bit for bit eller innenfor toleranse" in ut
|
||||
# Measured in Cowork 2026-11-11: numpy 2.5.3 (not the pinned 2.5.4) still gave bit for bit,
|
||||
# so the message must not promise a tolerance comparison.
|
||||
assert "ikke bit for bit" not in ut
|
||||
|
||||
|
||||
def test_opprett_som_feiler_gir_kode_3(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
|
|
|
|||
|
|
@ -45,6 +45,20 @@ def test_tekst_endret(fasit: str, naa: str) -> None:
|
|||
assert resultat.detaljer
|
||||
|
||||
|
||||
def test_mange_forskjeller_kuttes_og_alt_viser_resten(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Cowork-prøven 2026-11-11: 274 linjer ble kuttet uten at brukeren kunne få dem fram."""
|
||||
fasit = [f"linje {i}" for i in range(60)]
|
||||
naa = [f"rad {i}" for i in range(60)]
|
||||
kort = kontroll.forskjeller(fasit, naa)
|
||||
assert len(kort) == kontroll.MAKS_LINJER + 1
|
||||
assert kort[-1].endswith("linjer til; «kontroll --alt» viser alle)")
|
||||
monkeypatch.setattr(kontroll, "VISNING", {"alt": True})
|
||||
alle = kontroll.forskjeller(fasit, naa)
|
||||
assert "-linje 59" in alle
|
||||
assert "+rad 59" in alle
|
||||
assert not any("linjer til" in linje for linje in alle)
|
||||
|
||||
|
||||
DAT = "t K Q\n0.00000 1.00000 0.29100\n0.50000 1.10000 0.30000\n"
|
||||
|
||||
|
||||
|
|
@ -183,6 +197,18 @@ def test_manglende_fasit(lett_kopi: Path, hjem: Path) -> None:
|
|||
assert "norge_2025: fant ikke fasit/diagnose_norge_2025.txt" in prosess.stdout
|
||||
|
||||
|
||||
def test_kontroll_avviser_ukjent_valg(hjem: Path) -> None:
|
||||
prosess = kjor("kontroll", "--alle", hjem=hjem)
|
||||
assert prosess.returncode == 2
|
||||
assert "Bruk: kjor.py kontroll [--rask] [--alt]" in prosess.stderr
|
||||
|
||||
|
||||
def test_kontroll_med_alt_gir_samme_dom(lett_kopi: Path, hjem: Path) -> None:
|
||||
prosess = kjor("--modell", str(lett_kopi), "kontroll", "--rask", "--alt", hjem=hjem)
|
||||
assert prosess.returncode == 0, prosess.stdout + prosess.stderr
|
||||
assert "Nivå (uten full kjøring, --rask): bit for bit som notatet." in prosess.stdout
|
||||
|
||||
|
||||
def test_diagnose_krever_eksakt_likhet(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Funn 10: én enhet i siste siffer i diagnosen er endret, ikke innenfor toleranse."""
|
||||
fasit = tmp_path / "fasit"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue