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

Function TestClient_RemoveUser_HubBody

internal/nodes/client_hub_test.go:93–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestClient_RemoveUser_HubBody(t *testing.T) {
94 mh := &mockHub{resp: json.RawMessage(`{}`)}
95 c := NewClientWithHub("n", mh)
96 if err := c.RemoveUser(context.Background(), "tag-1", "user@@@tag-1"); err != nil {
97 t.Fatalf("unexpected: %v", err)
98 }
99 got, ok := mh.lastBody.(map[string]string)
100 if !ok {
101 t.Fatalf("expected map body, got %T", mh.lastBody)
102 }
103 if got["inbound_tag"] != "tag-1" || got["email"] != "user@@@tag-1" {
104 t.Fatalf("unexpected body: %+v", got)
105 }
106 if mh.lastMethod != "RemoveUser" {
107 t.Fatalf("unexpected method: %q", mh.lastMethod)
108 }
109}
110
111func TestClient_NilHub_ReturnsErrHubNotConfigured(t *testing.T) {
112 // hub == nil 是偏执检查路径:所有方法都应返回 ErrHubNotConfigured,

Callers

nothing calls this directly

Calls 2

NewClientWithHubFunction · 0.85
RemoveUserMethod · 0.65

Tested by

no test coverage detected