test_check_ok_integrity.py
python
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
1 day ago
| 1 | """Data-integrity — reuse must not clobber an existing side-check body.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from datetime import date |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from tools.check_ok.scaffold import scaffold_side_check |
| 9 | |
| 10 | |
| 11 | def test_reuse_preserves_operator_edits(tmp_path: Path) -> None: |
| 12 | first = scaffold_side_check( |
| 13 | tmp_path, |
| 14 | topic="preserve", |
| 15 | scope="original scope", |
| 16 | today=date(2026, 7, 17), |
| 17 | ) |
| 18 | marker = "OPERATOR-EDIT-MARKER" |
| 19 | first.path.write_text(first.path.read_text(encoding="utf-8") + f"\n{marker}\n", encoding="utf-8") |
| 20 | |
| 21 | second = scaffold_side_check( |
| 22 | tmp_path, |
| 23 | topic="preserve", |
| 24 | scope="should not overwrite", |
| 25 | today=date(2026, 7, 17), |
| 26 | ) |
| 27 | assert second.created is False |
| 28 | assert marker in second.path.read_text(encoding="utf-8") |
File History
1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
1 day ago