Skip to content

Commit 1949e4f

Browse files
HaoLiangWenHaoLiangWen
authored andcommitted
tests(selected_window): red test asserting 1.3-parity without completeness proof (fails on 1e48cfd)
1 parent 1e48cfd commit 1949e4f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎tests/test_run_json_selected_window.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,24 @@ def test_the_declared_revisions_are_a_fresh_list_of_the_one_constant(self):
10361036
self.assertEqual(again, ["1.3"]) # ... nor the next record
10371037
self.assertIsNot(first, again)
10381038

1039+
def test_without_a_completeness_proof_the_probe_declares_1_3_parity_only(self):
1040+
# Under amendment 6, "1.3" pairs only with value_ownership "complete", and no
1041+
# completeness proof has run (EN-115). Both capabilities_record(True) and the
1042+
# --capabilities-json probe must declare ["1.3-parity"] alone, never ["1.3"].
1043+
self.assertEqual(swr.CONTRACT_REVISIONS, ("1.3-parity",))
1044+
record = swr.capabilities_record(True)["capabilities"]
1045+
self.assertEqual(record["selected_window_contract_revisions"], ["1.3-parity"])
1046+
self.assertNotIn("1.3", record["selected_window_contract_revisions"])
1047+
lib = FakeLib(full_plan())
1048+
FakePlanner.reset(None)
1049+
with mock.patch.object(run_json, "load_strategy", lambda p: lib), \
1050+
mock.patch.object(swp, "SelectedPrimaryPlanner", FakePlanner):
1051+
status, out, _ = run_main(["--so", "x.so", "--capabilities-json"])
1052+
self.assertEqual(status, 0)
1053+
probed = json.loads(out)["capabilities"]["selected_window_contract_revisions"]
1054+
self.assertEqual(probed, ["1.3-parity"])
1055+
self.assertNotIn("1.3", probed)
1056+
10391057

10401058
# --- admission: nothing is touched before it passes --------------------------
10411059

0 commit comments

Comments
 (0)