(t *testing.T)
| 171 | } |
| 172 | |
| 173 | func TestHandler_InvalidToken(t *testing.T) { |
| 174 | hub := NewHub() |
| 175 | defer hub.Close() |
| 176 | store := &mockStore{user: nil, userErr: fmt.Errorf("not found")} |
| 177 | handler := NewHandler(hub, store) |
| 178 | srv := startServer(t, handler) |
| 179 | |
| 180 | resp := doHTTP(t, srv, "bot@agents.e2a.dev", "bad_key") |
| 181 | defer resp.Body.Close() |
| 182 | if resp.StatusCode != http.StatusUnauthorized { |
| 183 | t.Fatalf("expected 401, got %d", resp.StatusCode) |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | func TestHandler_AgentNotFound(t *testing.T) { |
| 188 | hub := NewHub() |
nothing calls this directly
no test coverage detected