generated from coulomb/repo-seed
Add canon reset and reingest guardrails
This commit is contained in:
@@ -74,6 +74,43 @@ def test_registry_scan_manifest_writes_default_cache_and_report(tmp_path: Path,
|
||||
assert not (cache_dir / "rescan.lock").exists()
|
||||
|
||||
|
||||
def test_registry_scan_manifest_disambiguates_normalized_snapshot_names(tmp_path: Path, capsys) -> None:
|
||||
repo_a = _minimal_repo(tmp_path, "vergabe-teilnahme")
|
||||
repo_b = _minimal_repo(tmp_path, "vergabe_teilnahme")
|
||||
manifest = _manifest(
|
||||
tmp_path,
|
||||
[
|
||||
{"slug": "vergabe-teilnahme", "name": "Vergabe Teilnahme", "path": str(repo_a)},
|
||||
{"slug": "vergabe_teilnahme", "name": "Vergabe Teilnahme Alt", "path": str(repo_b)},
|
||||
],
|
||||
)
|
||||
output_dir = tmp_path / "snapshots"
|
||||
|
||||
assert cli_main(
|
||||
[
|
||||
"registry",
|
||||
"scan-manifest",
|
||||
str(manifest),
|
||||
"--dry-run",
|
||||
"--output-dir",
|
||||
str(output_dir),
|
||||
"--json",
|
||||
]
|
||||
) == 0
|
||||
|
||||
summary = json.loads(capsys.readouterr().out)
|
||||
output_paths = [item["output_path"] for item in summary["repositories"]]
|
||||
assert len(output_paths) == 2
|
||||
assert len(set(output_paths)) == 2
|
||||
assert (output_dir / "vergabe-teilnahme-deterministic.discovery.json").is_file()
|
||||
disambiguated = [
|
||||
path
|
||||
for path in output_dir.glob("vergabe-teilnahme-*-deterministic.discovery.json")
|
||||
if path.name != "vergabe-teilnahme-deterministic.discovery.json"
|
||||
]
|
||||
assert len(disambiguated) == 1
|
||||
|
||||
|
||||
def test_registry_scan_manifest_operational_exit_codes_and_lock(tmp_path: Path, capsys) -> None:
|
||||
repo = _minimal_repo(tmp_path, "fixture-repo")
|
||||
manifest = _manifest(tmp_path, [{"slug": "fixture-repo", "name": "Fixture Repo", "path": str(repo)}])
|
||||
|
||||
Reference in New Issue
Block a user