MCPcopy Create free account
hub / github.com/cli/cli / Test_ValidateKey

Function Test_ValidateKey

pkg/cmd/config/set/set_test.go:198–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

196}
197
198func Test_ValidateKey(t *testing.T) {
199 err := ValidateKey("invalid")
200 assert.EqualError(t, err, "invalid key")
201
202 err = ValidateKey("git_protocol")
203 assert.NoError(t, err)
204
205 err = ValidateKey("editor")
206 assert.NoError(t, err)
207
208 err = ValidateKey("prompt")
209 assert.NoError(t, err)
210
211 err = ValidateKey("pager")
212 assert.NoError(t, err)
213
214 err = ValidateKey("http_unix_socket")
215 assert.NoError(t, err)
216
217 err = ValidateKey("browser")
218 assert.NoError(t, err)
219
220 err = ValidateKey("api_host")
221 assert.NoError(t, err)
222}
223
224func Test_isPerHostOnly(t *testing.T) {
225 assert.True(t, isPerHostOnly("api_host"))

Callers

nothing calls this directly

Calls 1

ValidateKeyFunction · 0.85

Tested by

no test coverage detected