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

Function Test_PostConfig_UpdatesConfig

pkg/configs/api/api_test.go:114–126  ·  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

112
113// Posting to a configuration sets it so that you can get it again.
114func Test_PostConfig_UpdatesConfig(t *testing.T) {
115 setup(t)
116 defer cleanup(t)
117
118 userID := makeUserID()
119 for _, c := range allClients {
120 view1 := c.post(t, userID, makeConfig())
121 config2 := makeConfig()
122 view2 := c.post(t, userID, config2)
123 assert.True(t, view2.ID > view1.ID, "%v > %v", view2.ID, view1.ID)
124 assert.Equal(t, config2, view2.Config)
125 }
126}
127
128// Different users can have different configurations.
129func Test_PostConfig_MultipleUsers(t *testing.T) {

Callers

nothing calls this directly

Calls 6

setupFunction · 0.85
cleanupFunction · 0.85
makeUserIDFunction · 0.85
makeConfigFunction · 0.85
postMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected