mirror of
https://github.com/warmbly/warmbly.git
synced 2026-10-12 16:02:44 +00:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
24 lines
545 B
Go
24 lines
545 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func TestSSEEmitterDoesNotStoreEvents(t *testing.T) {
|
|
gin.SetMode(gin.TestMode)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(http.MethodPost, "/v1/ai/agent", nil)
|
|
sseEmitter(c)
|
|
if got := w.Header().Get("Cache-Control"); got != "no-cache, no-store" {
|
|
t.Errorf("Cache-Control = %q, want no-cache, no-store", got)
|
|
}
|
|
if !w.Flushed {
|
|
t.Error("event stream should flush immediately")
|
|
}
|
|
}
|