MCPcopy
hub / github.com/mochi-mqtt/server / TestHooksOnUnsubscribe

Function TestHooksOnUnsubscribe

hooks_test.go:320–333  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

318}
319
320func TestHooksOnUnsubscribe(t *testing.T) {
321 h := new(Hooks)
322 err := h.Add(new(modifiedHookBase), nil)
323 require.NoError(t, err)
324
325 pki := packets.Packet{
326 Filters: packets.Subscriptions{
327 {Filter: "a/b/c", Qos: 1},
328 },
329 }
330
331 pk := h.OnUnsubscribe(new(Client), pki)
332 require.EqualValues(t, pk, pki)
333}
334
335func TestHooksOnPublish(t *testing.T) {
336 h := new(Hooks)

Callers

nothing calls this directly

Calls 2

OnUnsubscribeMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected