From 775560a64cfc4051f52d83dc7477e45421b50f87 Mon Sep 17 00:00:00 2001 From: dschlueter Date: Sun, 11 Oct 2026 23:27:11 +0200 Subject: [PATCH] test: echte Reden liegen lokal in testdaten// mit ihrem Glossar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit testdaten/ enthält je Rede einen Ordner mit .vtt, .txt und dem Glossar der Rede, keine Ausgaben mehr; gemeinsame Glossare bleiben in glossare/. Die lokalen Rede-Tests lesen von dort. Co-Authored-By: Claude Opus 5.5 --- tests/test_abschrift_korrigieren.py | 14 ++++++++------ tests/test_vtt2txt.py | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_abschrift_korrigieren.py b/tests/test_abschrift_korrigieren.py index 1783ce7..c49b739 100644 --- a/tests/test_abschrift_korrigieren.py +++ b/tests/test_abschrift_korrigieren.py @@ -14,7 +14,8 @@ REPO = Path(__file__).resolve().parent.parent # Own, made-up sample speech; real speeches are only kept locally in testdaten/ SAMPLE = REPO / "tests" / "daten" / "beispiel.de.txt" GLOSSARY = REPO / "tests" / "daten" / "beispiel.glossar.txt" -# Real glossaries and speeches are only kept locally (see .gitignore) +# Real glossaries and speeches are only kept locally (see .gitignore): shared +# glossaries in glossare/, each speech with its glossary in testdaten// GLOSSARIES = REPO / "glossare" SHARED_GLOSSARY = GLOSSARIES / "krone-schmalz.glossar.txt" SPEECHES = REPO / "testdaten" @@ -127,17 +128,18 @@ def test_build_system_appends_terms(): assert "keep only the surname" in ak.SYSTEM_EN +# testdaten//: raw text and the glossary of that speech SAMPLE_GLOSSARIES = [ - ("ramstein.glossar.txt", "ramstein.de.txt"), - ("magdeburg.glossar.txt", "magdeburg.de-orig.txt"), - ("lahnstein.glossar.txt", "Lahnstein.de-orig.txt"), + ("ramstein/ramstein.glossar.txt", "ramstein/ramstein.de.txt"), + ("magdeburg/magdeburg.glossar.txt", "magdeburg/magdeburg.de-orig.txt"), + ("lahnstein/lahnstein.glossar.txt", "lahnstein/Lahnstein.de-orig.txt"), ] # Real speeches and their glossaries are not in the repository; without them these skip needs_speeches = pytest.mark.skipif( not all( - (SPEECHES / sample).is_file() and (GLOSSARIES / glossary).is_file() + (SPEECHES / sample).is_file() and (SPEECHES / glossary).is_file() for glossary, sample in SAMPLE_GLOSSARIES ) or not SHARED_GLOSSARY.is_file(), reason="echte Reden (testdaten/) und ihre Glossare nur lokal", @@ -157,7 +159,7 @@ def test_sample_glossary_replacements_all_match(capsys, glossary, sample): text = flat((SPEECHES / sample).read_text(encoding="utf-8")) text = ak.apply_replacements(text, ak.read_glossary(SHARED_GLOSSARY)[1]) capsys.readouterr() - ak.apply_replacements(text, ak.read_glossary(GLOSSARIES / glossary)[1]) + ak.apply_replacements(text, ak.read_glossary(SPEECHES / glossary)[1]) assert "ohne Treffer" not in capsys.readouterr().out diff --git a/tests/test_vtt2txt.py b/tests/test_vtt2txt.py index 84abb81..52abe50 100644 --- a/tests/test_vtt2txt.py +++ b/tests/test_vtt2txt.py @@ -124,8 +124,8 @@ def speech(name): @pytest.mark.parametrize("vtt_path", [ SAMPLE_VTT, - speech("ramstein.de.vtt"), speech("magdeburg.de-orig.vtt"), - speech("Lahnstein.de-orig.vtt"), + speech("ramstein/ramstein.de.vtt"), speech("magdeburg/magdeburg.de-orig.vtt"), + speech("lahnstein/Lahnstein.de-orig.vtt"), ]) def test_sample_vtt_gives_sample_txt(vtt_path): vtt = vtt_path.read_text(encoding="utf-8-sig")