Skip to content

Commit e52bd6a

Browse files
authored
test(mesh): pin DEFAULT_BRIDGE_SUFFIXES and not-bridged list (#355)
Adds regression pins for DEFAULT_BRIDGE_SUFFIXES exact membership and the high-volume/LAN-only suffixes documented as not bridged by default. A future edit to the tuple now fails the test unless the docs are updated in the same diff. closes #241
1 parent 3646b7c commit e52bd6a

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

tests/mesh/test_bridge_transport.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,49 @@ def test_partial_handles(self):
287287
h = _BridgeSubHandle(a, None)
288288
h.undeclare()
289289
a.undeclare.assert_called_once()
290+
291+
292+
class TestDefaultBridgeSuffixesPinned:
293+
def test_default_bridge_suffixes_pinned_to_documented_set(self):
294+
"""Pin DEFAULT_BRIDGE_SUFFIXES against the documented bridge-by-default set.
295+
296+
These suffixes are documented in the module header and the mesh env-var
297+
matrix as the unset-default for STRANDS_MESH_BRIDGE_TOPICS. A future edit
298+
that adds or removes a suffix here must update that documentation in the
299+
same diff or this test fails.
300+
"""
301+
assert DEFAULT_BRIDGE_SUFFIXES == frozenset(
302+
{
303+
"presence",
304+
"health",
305+
"safety/event",
306+
"safety/estop",
307+
"safety/resume",
308+
"cmd",
309+
"response",
310+
"broadcast",
311+
}
312+
)
313+
314+
def test_high_volume_telemetry_not_bridged_by_default(self):
315+
"""Pin the documented high-volume-telemetry not-bridged list.
316+
317+
state/pose/imu/odom/lidar are high volume and camera/input/hand are
318+
LAN-only by definition. All are documented as not bridged by default;
319+
if one leaks into DEFAULT_BRIDGE_SUFFIXES the documentation regresses.
320+
"""
321+
not_bridged = (
322+
"state",
323+
"pose",
324+
"imu",
325+
"odom",
326+
"lidar",
327+
"camera",
328+
"input",
329+
"hand",
330+
)
331+
for suffix in not_bridged:
332+
assert suffix not in DEFAULT_BRIDGE_SUFFIXES, (
333+
f"{suffix!r} is documented as not bridged by default but is in "
334+
f"DEFAULT_BRIDGE_SUFFIXES; remove it or update the documentation."
335+
)

0 commit comments

Comments
 (0)