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

Function Test_GetAllConfigs

pkg/configs/api/api_test.go:162–180  ·  view source on GitHub ↗

GetAllConfigs returns all created userconfig.

(t *testing.T)

Source from the content-addressed store, hash-verified

160
161// GetAllConfigs returns all created userconfig.
162func Test_GetAllConfigs(t *testing.T) {
163 setup(t)
164 defer cleanup(t)
165
166 userID := makeUserID()
167 config := makeConfig()
168
169 for _, c := range allClients {
170 view := c.post(t, userID, config)
171 w := request(t, "GET", c.PrivateEndpoint, nil)
172 assert.Equal(t, http.StatusOK, w.Code)
173 var found ConfigsView
174 err := json.Unmarshal(w.Body.Bytes(), &found)
175 assert.NoError(t, err, "Could not unmarshal JSON")
176 assert.Equal(t, ConfigsView{Configs: map[string]userconfig.View{
177 userID: view,
178 }}, found)
179 }
180}
181
182// GetAllConfigs returns the *newest* versions of all created userconfig.
183func Test_GetAllConfigs_Newest(t *testing.T) {

Callers

nothing calls this directly

Calls 9

setupFunction · 0.85
cleanupFunction · 0.85
makeUserIDFunction · 0.85
makeConfigFunction · 0.85
postMethod · 0.80
requestFunction · 0.70
EqualMethod · 0.65
BytesMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected