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

Function Test_PostConfig_CreatesConfig

pkg/configs/api/api_test.go:95–111  ·  view source on GitHub ↗

Posting to a configuration sets it so that you can get it again.

(t *testing.T)

Source from the content-addressed store, hash-verified

93
94// Posting to a configuration sets it so that you can get it again.
95func Test_PostConfig_CreatesConfig(t *testing.T) {
96 setup(t)
97 defer cleanup(t)
98
99 userID := makeUserID()
100 config := makeConfig()
101 for _, c := range allClients {
102 {
103 w := requestAsUser(t, userID, "POST", c.Endpoint, "", readerFromConfig(t, config))
104 assert.Equal(t, http.StatusNoContent, w.Code)
105 }
106 {
107 w := requestAsUser(t, userID, "GET", c.Endpoint, "", nil)
108 assert.Equal(t, config, parseView(t, w.Body.Bytes()).Config)
109 }
110 }
111}
112
113// Posting to a configuration sets it so that you can get it again.
114func Test_PostConfig_UpdatesConfig(t *testing.T) {

Callers

nothing calls this directly

Calls 9

setupFunction · 0.85
cleanupFunction · 0.85
makeUserIDFunction · 0.85
makeConfigFunction · 0.85
requestAsUserFunction · 0.85
readerFromConfigFunction · 0.85
parseViewFunction · 0.85
EqualMethod · 0.65
BytesMethod · 0.65

Tested by

no test coverage detected