(t *testing.T)
| 197 | } |
| 198 | |
| 199 | func 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 | |
| 212 | func TestAPIDispatcher_IPSentinelNotConfigured(t *testing.T) { |
| 213 | t.Parallel() |
nothing calls this directly
no test coverage detected