test(rack): cover off-rack peer (styled, not clickable) in network graph
All checks were successful
Build docs site / build (push) Successful in 49s
Build slides / build (push) Successful in 1m8s

This commit is contained in:
sjat 2026-06-24 18:48:13 +02:00
parent d3d5e9c69e
commit e1c05a6c88

View file

@ -725,3 +725,14 @@ def test_network_graph_colors_and_links_nodes():
assert "style sw01 fill:" in out
assert 'click sw01 "/hardware/sw01/"' in out
assert 'click srv01 "/hardware/srv01/"' in out
def test_network_graph_off_rack_peer_has_no_click():
items = [
item(hostname="srv01", rack_u=1, u_height=1, rack_face="front",
links=[{"local": "eth0", "peer": "router0", "peer_port": 1}]),
]
out = gen_rack.render_network("rack01", items)
assert "style router0 fill:" in out # off-rack peer is still colored
assert 'click router0 "' not in out # but it is NOT clickable
assert 'click srv01 "/hardware/srv01/"' in out