build: alle Template-PDFs automatisch in Build und Release aufnehmen
Alle *.pdf im template-Ordner werden ausgeliefert; Dateien mit '_' oder '.' am Anfang sowie andere Dateitypen werden ignoriert. Veraltete PDFs im Build-Ordner werden entfernt. Tests entsprechend angepasst. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2237779e56
commit
7de6984ebc
4 files changed
+42
-12
No files matched your search
@@ -17,11 +17,15 @@ build = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(build)
|
||||
|
||||
|
||||
TEMPLATE_NAMES = ["template/A Vorlage.pdf", "template/B Vorlage.PDF"]
|
||||
IGNORED_NAMES = ["template/_alt.pdf", "template/.versteckt.pdf", "template/A Vorlage.odg"]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def release(tmp_path):
|
||||
directory = tmp_path / "build"
|
||||
directory.mkdir()
|
||||
for name in deploy.PACKAGE_FILES:
|
||||
for name in deploy.PACKAGE_FILES + TEMPLATE_NAMES:
|
||||
path = directory / name
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(b"test release payload")
|
||||
@@ -33,13 +37,15 @@ def release(tmp_path):
|
||||
|
||||
def test_deployment_packages_release_without_work_files(release):
|
||||
directory, target = release
|
||||
for name in IGNORED_NAMES:
|
||||
(directory / name).write_bytes(b"ignored")
|
||||
for folder in ["input", "output"]:
|
||||
(directory / folder).mkdir()
|
||||
(directory / folder / "private.xlsx").write_bytes(b"private")
|
||||
result = deploy.deploy(directory, target)
|
||||
assert result.name == "Tätigkeitsnachweis-Generator v1.3.0.zip"
|
||||
with zipfile.ZipFile(result) as archive:
|
||||
assert set(archive.namelist()) == set(deploy.PACKAGE_FILES + ["input/", "output/"])
|
||||
assert set(archive.namelist()) == set(deploy.PACKAGE_FILES + TEMPLATE_NAMES + ["input/", "output/"])
|
||||
assert archive.testzip() is None
|
||||
assert not list(target.glob(".upload-*"))
|
||||
# An unchanged release can be retried without overwriting the published ZIP.
|
||||
|
||||
@@ -15,7 +15,7 @@ from src.writer import generate_activity_reports
|
||||
|
||||
CONFIG_DIR = PROJECT_ROOT / "config"
|
||||
INPUT_FILE = Path(__file__).resolve().parent / "fixture" / "2026 JM.xlsx"
|
||||
TEMPLATE_FILE = PROJECT_ROOT / "template" / "Tätigkeitsnachweise Stellenförderung.pdf"
|
||||
TEMPLATE_FILE = PROJECT_ROOT / "template" / "06-2026 Tätigkeitsnachweise Stellenförderung.pdf"
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
||||
Reference in new issue
Block a user