MCPcopy Create free account
hub / github.com/gotify/server / TestDeleteClientShouldCloseConnection

Function TestDeleteClientShouldCloseConnection

api/stream/stream_test.go:178–199  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestDeleteClientShouldCloseConnection(t *testing.T) {
179 mode.Set(mode.Prod)
180 defer leaktest.Check(t)()
181 server, api := bootTestServer(staticUserID())
182 defer server.Close()
183 defer api.Close()
184
185 wsURL := wsURL(server.URL)
186
187 user := testClient(t, wsURL)
188 defer user.conn.Close()
189
190 waitForConnectedClients(api, 1)
191
192 api.Notify(1, &model.MessageExternal{Message: "msg"})
193 user.expectMessage(&model.MessageExternal{Message: "msg"})
194
195 api.NotifyDeletedClient(1, "customtoken")
196
197 api.Notify(1, &model.MessageExternal{Message: "msg"})
198 user.expectNoMessage()
199}
200
201func TestDeleteMultipleClients(t *testing.T) {
202 mode.Set(mode.TestDev)

Callers

nothing calls this directly

Calls 11

SetFunction · 0.92
bootTestServerFunction · 0.85
staticUserIDFunction · 0.85
wsURLFunction · 0.85
testClientFunction · 0.85
waitForConnectedClientsFunction · 0.85
expectMessageMethod · 0.80
NotifyDeletedClientMethod · 0.80
expectNoMessageMethod · 0.80
NotifyMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…