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

Function TestBasicInitWithLedgerPointer

hooks/auth/auth_test.go:51–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestBasicInitWithLedgerPointer(t *testing.T) {
52 h := new(Hook)
53 h.SetOpts(logger, nil)
54
55 ln := &Ledger{
56 Auth: []AuthRule{
57 {
58 Remote: "127.0.0.1",
59 Allow: true,
60 },
61 },
62 ACL: []ACLRule{
63 {
64 Remote: "127.0.0.1",
65 Filters: Filters{
66 "#": ReadWrite,
67 },
68 },
69 },
70 }
71
72 err := h.Init(&Options{
73 Ledger: ln,
74 })
75
76 require.NoError(t, err)
77 require.Same(t, ln, h.ledger)
78}
79
80func TestBasicInitWithLedgerJSON(t *testing.T) {
81 h := new(Hook)

Callers

nothing calls this directly

Calls 2

SetOptsMethod · 0.65
InitMethod · 0.65

Tested by

no test coverage detected