Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/normalize_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def main() -> None:
json.dumps(report, ensure_ascii=False, indent=2) + "\n",
encoding="utf-8",
)
print(json.dumps(report, ensure_ascii=False, indent=2))
print("Legacy normalization completed; details are available in the report.")


if __name__ == "__main__":
Expand Down
28 changes: 28 additions & 0 deletions tests/test_integrity.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import json
import subprocess
import sys
import tempfile
import unittest
Expand Down Expand Up @@ -196,6 +197,33 @@ def test_source_checksum_gate_rejects_modified_input(self) -> None:
istat_path=DEFAULT_ISTAT,
)

def test_legacy_normalization_does_not_log_report_data(self) -> None:
with tempfile.TemporaryDirectory() as directory:
output = Path(directory) / "normalized.csv"
report = Path(directory) / "report.json"
result = subprocess.run(
[
sys.executable,
str(ROOT / "scripts" / "normalize_legacy.py"),
"--output",
str(output),
"--report",
str(report),
],
check=True,
capture_output=True,
text=True,
)
self.assertEqual(
result.stdout,
"Legacy normalization completed; "
"details are available in the report.\n",
)
self.assertTrue(output.is_file())
self.assertTrue(report.is_file())
self.assertNotIn("legacy_uuid", result.stdout)
self.assertNotIn("corrections", result.stdout)


if __name__ == "__main__":
unittest.main()