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

Function Test_RepoClone_missingSSHURL

pkg/cmd/repo/clone/clone_test.go:279–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func Test_RepoClone_missingSSHURL(t *testing.T) {
280 reg := &httpmock.Registry{}
281 defer reg.Verify(t)
282 reg.Register(
283 httpmock.GraphQL(`query RepositoryInfo\b`),
284 httpmock.StringResponse(`
285 { "data": { "repository": {
286 "name": "REPO",
287 "owner": {"login": "OWNER"}
288 } } }
289 `))
290
291 cfg := config.NewMockConfig()
292 cfg.Set("", "git_protocol", "ssh")
293
294 _, err := runCloneCommandWithConfig(&http.Client{Transport: reg}, cfg, "OWNER/REPO")
295 require.EqualError(t, err, "invalid API response: repository OWNER/REPO is missing sshUrl")
296}
297
298func Test_RepoClone_hasParent(t *testing.T) {
299 reg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 7

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
NewMockConfigFunction · 0.92
SetMethod · 0.65

Tested by

no test coverage detected