fix: let check_freshness read the profile report

check_freshness ran profile_sync with --json and the detection flags,
which profile_sync refuses, so --profiles always reported an unreadable
report. The version check now lives on the report and travels in the
JSON and markdown outputs; check_freshness asks for --json
--check-version only.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 06:09:15 +02:00
1 parent 1a41e6a964
commit d6fc66274f
4 files changed
+74 -25

No files matched your search

+14 -1
View File
@@ -4022,7 +4022,20 @@ class TestOutputModesApplyTheirFlags(unittest.TestCase):
self.assertIn("prose under an older pin", out)
def test_extras_are_refused_with_json(self):
code, _, err = self._main("--json", "--check-version")
code, _, err = self._main("--json", "--detect-new-files")
self.assertEqual(code, 1)
self.assertIn("--detect-new-files", err)
def test_json_carries_the_version_check(self):
"""check_freshness asks for --json --check-version: refused, its
profile row read an empty report as unreadable on every run."""
code, out, err = self._main("--json", "--check-version")
self.assertEqual(code, 0, err)
rows = json.loads(out)
self.assertTrue(all("version" in row and "page_version" in row for row in rows))
def test_rankings_refuse_the_version_check(self):
code, _, err = self._main("--triage", "--check-version")
self.assertEqual(code, 1)
self.assertIn("--check-version", err)