MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestHubUnregisterNonMatchingConn

Function TestHubUnregisterNonMatchingConn

internal/ws/hub_test.go:79–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestHubUnregisterNonMatchingConn(t *testing.T) {
80 hub := NewHub()
81 defer hub.Close()
82
83 _, conn1 := newTestWSPair(t)
84 _, conn2 := newTestWSPair(t)
85
86 hub.Register("agent1", conn1)
87 // Unregister with wrong conn should not remove
88 hub.Unregister("agent1", conn2)
89
90 if !hub.IsConnected("agent1") {
91 t.Fatal("expected still connected when unregister conn doesn't match")
92 }
93}
94
95func TestHubRegisterReplacesOld(t *testing.T) {
96 hub := NewHub()

Callers

nothing calls this directly

Calls 6

CloseMethod · 0.95
RegisterMethod · 0.95
UnregisterMethod · 0.95
IsConnectedMethod · 0.95
NewHubFunction · 0.85
newTestWSPairFunction · 0.85

Tested by

no test coverage detected