chore: Glossare echter Beiträge nur noch lokal
*.glossar.txt enthält Namen realer Personen und Hörfehler realer Beiträge und steht jetzt in .gitignore; versioniert bleibt nur das Glossar der erfundenen Beispielrede (tests/daten/beispiel.glossar.txt). Die Tests der echten Glossare laufen nur, wenn Reden und Glossare lokal vorhanden sind; die URL-Tests nutzen ein eigenes Mini-Glossar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3be1ff8058
commit
33869e5f3e
1 changed files with 39 additions and 18 deletions
|
|
@ -132,10 +132,13 @@ SAMPLE_GLOSSARIES = [
|
|||
]
|
||||
|
||||
|
||||
# The real speeches are not in the repository (copyright); without them these skip
|
||||
# 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() for _, sample in SAMPLE_GLOSSARIES),
|
||||
reason="echte Reden nur lokal in testdaten/",
|
||||
not all(
|
||||
(SPEECHES / sample).is_file() and (REPO / glossary).is_file()
|
||||
for glossary, sample in SAMPLE_GLOSSARIES
|
||||
) or not SHARED_GLOSSARY.is_file(),
|
||||
reason="echte Reden (testdaten/) und ihre Glossare nur lokal",
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -622,9 +625,16 @@ def from_url(fake_yt_dlp, yt_dlp_installed, monkeypatch):
|
|||
monkeypatch.setattr(ak, "find_paragraph_starts", every_nth_start(5))
|
||||
|
||||
|
||||
def kreml_glossary(folder):
|
||||
"""The one glossary rule the fake video needs."""
|
||||
path = folder / "kreml.glossar.txt"
|
||||
path.write_text("Kremmel => Kreml\n", encoding="utf-8")
|
||||
return path
|
||||
|
||||
|
||||
def test_main_url_default_names(from_url, tmp_path, monkeypatch):
|
||||
monkeypatch.chdir(tmp_path)
|
||||
run_main(monkeypatch, "-u", URL, "-g", SHARED_GLOSSARY)
|
||||
run_main(monkeypatch, "-u", URL, "-g", kreml_glossary(tmp_path))
|
||||
|
||||
raw = (tmp_path / "Kanal_Rede_2026-03-28.txt").read_text(encoding="utf-8")
|
||||
assert raw == "Der Kremmel ist in Moskau.\nDas ist bekannt.\n"
|
||||
|
|
@ -914,7 +924,7 @@ def test_main_url_several_ranges(fake_yt_dlp, yt_dlp_installed, tmp_path, monkey
|
|||
monkeypatch.setattr(subprocess, "run", fake_yt_dlp(VIDEO, vtt=MULTI_VTT))
|
||||
sent = chunk_recorder(monkeypatch)
|
||||
monkeypatch.chdir(tmp_path)
|
||||
run_main(monkeypatch, "-u", URL, "-z", "0:00:00-0:00:30 0:02", "-g", SHARED_GLOSSARY)
|
||||
run_main(monkeypatch, "-u", URL, "-z", "0:00:00-0:00:30 0:02", "-g", kreml_glossary(tmp_path))
|
||||
|
||||
name = "Kanal_Rede_2026-03-28_bis_00-00-30+ab_00-02-00"
|
||||
assert (tmp_path / f"{name}.txt").read_text(encoding="utf-8") == (
|
||||
|
|
|
|||
Loading…
Reference in a new issue