Erster Versuch zweiter Schritt, configs ausgefüllt
This commit is contained in:
1 parent
2faa1689dd
commit
15d49acfc8
8 files changed
+35
-17
No files matched your search
@@ -35,9 +35,12 @@ def cfg():
|
||||
"Apr": "04", "Mai": "05", "Jun": "06", "Jul": "07",
|
||||
"Aug": "08", "Sep": "09", "Okt": "10", "Nov": "11", "Dez": "12",
|
||||
},
|
||||
"valid_status_codes": ["K", "KK", "E", "F", "P", "U"],
|
||||
"valid_status_codes": ["K", "KK", "E", "F", "P", "U", "A", "V"],
|
||||
"plan_hours_value": "6",
|
||||
"pauschale_value": "8,60",
|
||||
"pdf_field_ort": "unterschrift.ort",
|
||||
"pdf_field_erstellungsdatum": "unterschrift.datum",
|
||||
"pdf_pauschale_prefix": "pauschale_5",
|
||||
"pauschale_present_value": "1",
|
||||
"antragsnummer": "12345",
|
||||
"ort": "Teststadt",
|
||||
"template_pdf": "template/sab.pdf",
|
||||
|
||||
@@ -20,7 +20,10 @@ def cfg():
|
||||
"template_pdf": "template/sab.pdf",
|
||||
"output_dir": "output",
|
||||
"plan_hours_value": "6",
|
||||
"pauschale_value": "8,60",
|
||||
"pdf_field_ort": "unterschrift.ort",
|
||||
"pdf_field_erstellungsdatum": "unterschrift.datum",
|
||||
"pdf_pauschale_prefix": "pauschale_5",
|
||||
"pauschale_present_value": "1",
|
||||
"excel_year_pattern": "(20\\d{2})",
|
||||
"excel_name_header": "Name, Vorname",
|
||||
"excel_name_column": 1,
|
||||
@@ -70,11 +73,11 @@ class TestHeaderFields:
|
||||
|
||||
def test_ort(self, cfg):
|
||||
fields = build_field_dict(_make_attendance(), cfg, date(2026, 2, 1))
|
||||
assert fields["ort"] == "Leipzig"
|
||||
assert fields["unterschrift.ort"] == "Leipzig"
|
||||
|
||||
def test_erstellungsdatum(self, cfg):
|
||||
fields = build_field_dict(_make_attendance(), cfg, date(2026, 3, 27))
|
||||
assert fields["erstellungsdatum"] == "27.03.2026"
|
||||
assert fields["unterschrift.datum"] == "27.03.2026"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -104,7 +107,7 @@ class TestPresentDay:
|
||||
|
||||
def test_pauschale_set(self, cfg):
|
||||
fields = build_field_dict(_make_attendance(_present(3, 6.0)), cfg, date(2026, 2, 1))
|
||||
assert fields["pauschale.0"] == "8,60"
|
||||
assert fields["pauschale_5.0"] == "1"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -130,7 +133,7 @@ class TestAbsentDay:
|
||||
@pytest.mark.parametrize("status", ["K", "KK", "E", "F", "P", "U"])
|
||||
def test_pauschale_empty(self, cfg, status):
|
||||
fields = build_field_dict(_make_attendance(_absent(4, status)), cfg, date(2026, 2, 1))
|
||||
assert fields["pauschale.0"] == ""
|
||||
assert fields["pauschale_5.0"] == "0"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -28,9 +28,12 @@ def _write_config(tmp_path: Path, overrides: dict = None) -> Path:
|
||||
"excel_day_start_col": 9,
|
||||
"excel_day_end_col": 39,
|
||||
"month_mapping": {"Feb": "02", "Jan": "01"},
|
||||
"valid_status_codes": ["K", "KK", "E", "F", "P", "U"],
|
||||
"valid_status_codes": ["K", "KK", "E", "F", "P", "U", "A", "V"],
|
||||
"plan_hours_value": "6",
|
||||
"pauschale_value": "8,60",
|
||||
"pdf_field_ort": "unterschrift.ort",
|
||||
"pdf_field_erstellungsdatum": "unterschrift.datum",
|
||||
"pdf_pauschale_prefix": "pauschale_5",
|
||||
"pauschale_present_value": "1",
|
||||
}
|
||||
if overrides:
|
||||
cfg.update(overrides)
|
||||
|
||||
Reference in new issue
Block a user