test: run history-independent identity checks before the history lookup

This commit is contained in:
Grok committed 2026-10-21 16:49:41 +08:00
1 parent d437faa501
commit fce24a64e8
4 files changed
+22 -15

No files matched your search

+5 -2
View File
@@ -48,8 +48,11 @@ class GuardTests(unittest.TestCase):
def test_current_corrected_pins(self):
with TemporaryDirectory() as directory:
root = historical_tree(A135, directory)
with patch("run_uniform_les_flow.subprocess.check_output", return_value=A135 + "\n"):
self.assertEqual(source_guard(root, "corrected", "a135252")["base_commit"], A135)
with patch("run_uniform_les_flow.subprocess.check_output", return_value="historical-tree\n"):
identity = source_guard(root, "corrected", "a135252")
# base_commit comes from the pins file; the mock only feeds checkout_commit.
self.assertEqual(identity["base_commit"], A135)
self.assertEqual(identity["checkout_commit"], "historical-tree")
def test_corrected_and_tamper_guard(self):
pins = json.loads((HERE / "data/les_flow/source_pins_a135252.json").read_text())