MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / TestAPIDispatcher_AddRemoveUserOK

Function TestAPIDispatcher_AddRemoveUserOK

internal/nodeagent/dispatch_test.go:199–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestAPIDispatcher_AddRemoveUserOK(t *testing.T) {
200 t.Parallel()
201 d := NewAPIDispatcher(newTestAPI(), nil)
202 add := `{"inbound_tag":"vless-1","email":"a@@@vless-1","uuid":"u","protocol":"vless"}`
203 if _, err := d.Handle(context.Background(), "AddUser", json.RawMessage(add)); err != nil {
204 t.Fatalf("AddUser: %v", err)
205 }
206 rm := `{"inbound_tag":"vless-1","email":"a@@@vless-1"}`
207 if _, err := d.Handle(context.Background(), "RemoveUser", json.RawMessage(rm)); err != nil {
208 t.Fatalf("RemoveUser: %v", err)
209 }
210}
211
212func TestAPIDispatcher_IPSentinelNotConfigured(t *testing.T) {
213 t.Parallel()

Callers

nothing calls this directly

Calls 3

HandleMethod · 0.95
NewAPIDispatcherFunction · 0.85
newTestAPIFunction · 0.85

Tested by

no test coverage detected