diff --git a/tests/batterie_live_naehe_spec.py b/tests/batterie_live_naehe_spec.py index 56e83792..305f8254 100644 --- a/tests/batterie_live_naehe_spec.py +++ b/tests/batterie_live_naehe_spec.py @@ -249,7 +249,14 @@ class Laeufe(unittest.TestCase): def test_ohne_schalter_kein_byte_anders(self): self.basis("ohne", "--profil", "1") - with open(self.datei("ohne"), "rb") as f: self.assertEqual(hashlib.sha256(f.read()).hexdigest(), GOLD_OHNE_SCHALTER) + with open(self.datei("ohne"), "r", encoding="utf-8") as f: roh = f.read() + # Since the certified-table rebuild every row carries `welt5_stempel`; without it the rows must still be byte-identical to the gold, + # and a raw comparison run must be stamped UNZERTIFIZIERT in every row. + stempel = re.findall(r',"welt5_stempel":(\{[^{}]*\})', roh) + self.assertEqual(len(stempel), roh.count("\n")) + self.assertTrue(all(json.loads(s)["zertifikat"].startswith("UNZERTIFIZIERT") for s in stempel)) + ohne_stempel = re.sub(r',"welt5_stempel":\{[^{}]*\}', "", roh) + self.assertEqual(hashlib.sha256(ohne_stempel.encode("utf-8")).hexdigest(), GOLD_OHNE_SCHALTER) def test_splash_zeilen_tragen_den_betrag(self): z = self.basis("splash", "--splash", "1.0:5=1")