MCPcopy Create free account
hub / github.com/cortexproject/cortex / Test_GetAllConfigs_Empty

Function Test_GetAllConfigs_Empty

pkg/configs/api/api_test.go:147–159  ·  view source on GitHub ↗

GetAllConfigs returns an empty list of configs if there aren't any.

(t *testing.T)

Source from the content-addressed store, hash-verified

145
146// GetAllConfigs returns an empty list of configs if there aren't any.
147func Test_GetAllConfigs_Empty(t *testing.T) {
148 setup(t)
149 defer cleanup(t)
150
151 for _, c := range allClients {
152 w := request(t, "GET", c.PrivateEndpoint, nil)
153 assert.Equal(t, http.StatusOK, w.Code)
154 var found ConfigsView
155 err := json.Unmarshal(w.Body.Bytes(), &found)
156 assert.NoError(t, err, "Could not unmarshal JSON")
157 assert.Equal(t, ConfigsView{Configs: map[string]userconfig.View{}}, found)
158 }
159}
160
161// GetAllConfigs returns all created userconfig.
162func Test_GetAllConfigs(t *testing.T) {

Callers

nothing calls this directly

Calls 6

setupFunction · 0.85
cleanupFunction · 0.85
requestFunction · 0.70
EqualMethod · 0.65
BytesMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected