Skip to content

Commit fd88ec9

Browse files
committed
CMR-11416: add 3-node and rho-shape cycle detection tests
1 parent 04fe88d commit fd88ec9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

search-proxy/test/test_config.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,27 @@ def test_overflow_cycle_raises(self):
242242
]
243243
)
244244

245+
def test_three_node_cycle_raises(self):
246+
with pytest.raises(ValidationError, match="cycle"):
247+
LanesConfig(
248+
lanes=[
249+
LaneConfig(name="a", permits=10, overflow="b", default=True),
250+
LaneConfig(name="b", permits=10, overflow="c"),
251+
LaneConfig(name="c", permits=10, overflow="a"),
252+
]
253+
)
254+
255+
def test_rho_shape_cycle_raises(self):
256+
"""A→B→C→B: cycle not involving the start node."""
257+
with pytest.raises(ValidationError, match="cycle"):
258+
LanesConfig(
259+
lanes=[
260+
LaneConfig(name="a", permits=10, overflow="b", default=True),
261+
LaneConfig(name="b", permits=10, overflow="c"),
262+
LaneConfig(name="c", permits=10, overflow="b"),
263+
]
264+
)
265+
245266
def test_get_unknown_lane_returns_default(self):
246267
config = LanesConfig(
247268
lanes=[

0 commit comments

Comments
 (0)