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

Function TestClientAuthenticatedCommandRejectsEmptyCredentialPattern

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

Source from the content-addressed store, hash-verified

108}
109
110func TestClientAuthenticatedCommandRejectsEmptyCredentialPattern(t *testing.T) {
111 // Given a client and an empty host-scoped credential pattern
112 client := Client{GitPath: "path/to/git"}
113
114 // When an authenticated command is created
115 cmd, err := client.AuthenticatedCommand(t.Context(), CredentialPattern{}, "fetch")
116
117 // Then the insecure ambiguous scope is rejected
118 require.EqualError(t, err, "empty credential pattern is not allowed unless provided explicitly")
119 assert.Nil(t, cmd)
120}
121
122func TestClientRemotesReturnsSortedRemotesWithResolutions(t *testing.T) {
123 // Given remotes with resolution metadata

Callers

nothing calls this directly

Calls 1

AuthenticatedCommandMethod · 0.95

Tested by

no test coverage detected