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

Function TestClientConfigReportsUnknownKey

git/client_test.go:334–345  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

332}
333
334func TestClientConfigReportsUnknownKey(t *testing.T) {
335 // Given a repository without a credential helper
336 repo := newTestRepo(t)
337
338 // When the missing configuration is read
339 value, err := repo.client.Config(t.Context(), "credential.helper")
340
341 // Then the missing key is identified
342 require.Error(t, err)
343 assert.EqualError(t, err, "failed to run git: unknown config key credential.helper")
344 assert.Empty(t, value)
345}
346
347func TestClientConfigPropagatesGitError(t *testing.T) {
348 // Given a client whose repository directory does not exist

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
EmptyMethod · 0.80
ConfigMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected