[scripts] (P7): the parity self-test patches the seam the Magma tiers read through

Package D added a test that patches lane_cases and hands spawn_lane_parity.py a
placeholder build dir; package L then made the three Magma tiers read through a new
lane_names, so the placeholder reached a real ctest and the unit label went red on the
integrated tree. Patching lane_names to an empty set on every arm makes those tiers
report "nothing to compare" and leaves the assertion about lane_cases intact.
This commit is contained in:
2026-09-22 14:43:51 -04:00
parent 8bb6309a1c
commit 801f8edaa6
+5
View File
@@ -90,10 +90,15 @@ class Accounting(unittest.TestCase):
def test_equal_counts_do_not_hide_a_missing_case(self):
parity = module('spawn_lane_parity')
a, b = 'TriangleScenario.Draw', 'TriangleScenario.Read'
# The Magma tiers (P7 package L) read through lane_names, not lane_cases; an empty set
# on every arm makes compare_arms report "nothing to compare" and stay out of this
# assertion, instead of running a real ctest in the placeholder build dir.
with patch.object(parity, 'lane_cases', side_effect=[{a}, {a}, {b}]), \
patch.object(parity, 'lane_names', return_value=set()), \
patch.object(sys, 'argv', ['spawn_lane_parity.py', 'unused']):
self.assertEqual(parity.main(), 1)
with patch.object(parity, 'lane_cases', return_value={a}), \
patch.object(parity, 'lane_names', return_value=set()), \
patch.object(sys, 'argv', ['spawn_lane_parity.py', 'unused']):
self.assertEqual(parity.main(), 0)