MCPcopy Index your code
hub / github.com/cortexproject/cortex / TestWriteTextResponse

Function TestWriteTextResponse

pkg/util/http_test.go:83–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestWriteTextResponse(t *testing.T) {
84 w := httptest.NewRecorder()
85
86 util.WriteTextResponse(w, "hello world")
87
88 assert.Equal(t, 200, w.Code)
89 assert.Equal(t, "hello world", w.Body.String())
90 assert.Equal(t, "text/plain", w.Header().Get("Content-Type"))
91}
92
93func TestStreamWriteYAMLResponse(t *testing.T) {
94 type testStruct struct {

Callers

nothing calls this directly

Calls 5

WriteTextResponseFunction · 0.92
EqualMethod · 0.65
StringMethod · 0.65
GetMethod · 0.65
HeaderMethod · 0.45

Tested by

no test coverage detected