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
1 change: 1 addition & 0 deletions spec/fidelity_honesty.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def buckets(path):
if isinstance(d, dict)
and isinstance(d.get("path"), str)
and isinstance(d.get("repos"), list)
and d["repos"]
and all(isinstance(r, str) for r in d["repos"])
and isinstance(d.get("disposition"), str)
and isinstance(d.get("reason"), str)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_fidelity_honesty.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ def test_a_disposition_row_with_a_non_string_repo_is_dropped_rather_than_raising
out = fidelity_honesty.render_report([], [], {}, [], {"dispositions": [bad]}, {})
self.assertNotIn("x.md", out)

def test_a_disposition_row_with_no_repos_is_not_read_as_resolved(self) -> None:
empty = {"path": "x.md", "repos": [], "disposition": "accepted", "reason": "r"}
spread = {"differs": ["A"], "stale": [], "absent": [], "match": [], "unavailable": []}
spreads = [({"path": "x.md", "fidelity": "verbatim"}, spread)]
out = fidelity_honesty.render_report(spreads, [], {}, [], {"dispositions": [empty]}, {})
self.assertNotIn("## Resolved", out)
self.assertIn("x.md", out.split("## Untriaged", 1)[1])

def test_main_spec_carries_the_ledger_retired_paths(self) -> None:
"""Without the ledger in the spec, every path retired outright drops out of the gap pass."""
self.assertEqual(
Expand Down
7 changes: 5 additions & 2 deletions tests/test_spec_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import audit
import secret_names
import validate
from git_env import without_git_location

CHECK_TYPES = {"types": {"python": {"checks": [{"id": "python.typed"}]}}, "crossCutting": {}}

Expand Down Expand Up @@ -3088,10 +3089,12 @@ def test_the_drop_check_runs_where_the_ledger_is_absent(self) -> None:
encoding="utf-8",
)
(root / "spec" / "divergences.json").unlink()
subprocess.run(["git", "-C", str(root), "init", "-q"], check=True, timeout=60)
subprocess.run(["git", "-C", str(root), "add", "spec"], check=True, timeout=60)
env = without_git_location()
subprocess.run(["git", "-C", str(root), "init", "-q"], check=True, timeout=60, env=env)
subprocess.run(["git", "-C", str(root), "add", "spec"], check=True, timeout=60, env=env)
result = subprocess.run(
[sys.executable, str(root / "spec" / "validate.py")],
env=env,
capture_output=True,
text=True,
encoding="utf-8",
Expand Down
Loading