forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct API in readyHandler (grafana/phlare#516)
- Loading branch information
1 parent
054edda
commit 0bde110
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package util_test | ||
|
||
import ( | ||
"net/http/httptest" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/grafana/phlare/pkg/util" | ||
) | ||
|
||
func TestWriteTextResponse(t *testing.T) { | ||
w := httptest.NewRecorder() | ||
|
||
util.WriteTextResponse(w, "hello world") | ||
|
||
assert.Equal(t, 200, w.Code) | ||
assert.Equal(t, "hello world", w.Body.String()) | ||
assert.Equal(t, "text/plain", w.Header().Get("Content-Type")) | ||
} |