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

Function Test_RepoClone_noParent_noUpstream

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

Source from the content-addressed store, hash-verified

397}
398
399func Test_RepoClone_noParent_noUpstream(t *testing.T) {
400 reg := &httpmock.Registry{}
401 defer reg.Verify(t)
402 reg.Register(
403 httpmock.GraphQL(`query RepositoryInfo\b`),
404 httpmock.StringResponse(`
405 { "data": { "repository": {
406 "name": "REPO",
407 "owner": {
408 "login": "OWNER"
409 }
410 } } }
411 `))
412
413 httpClient := &http.Client{Transport: reg}
414
415 cs, cmdTeardown := run.Stub()
416 defer cmdTeardown(t)
417
418 cs.Register(`git clone https://github.com/OWNER/REPO.git`, 0, "")
419
420 _, err := runCloneCommand(httpClient, "OWNER/REPO --no-upstream")
421 if err != nil {
422 t.Fatalf("error running command `repo clone`: %v", err)
423 }
424}
425
426func TestSimplifyURL(t *testing.T) {
427 tests := []struct {

Callers

nothing calls this directly

Calls 6

VerifyMethod · 0.95
RegisterMethod · 0.95
GraphQLFunction · 0.92
StringResponseFunction · 0.92
StubFunction · 0.92
runCloneCommandFunction · 0.70

Tested by

no test coverage detected