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

Function TestManager_repo_not_found

pkg/cmd/extension/manager_test.go:1335–1360  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1333}
1334
1335func TestManager_repo_not_found(t *testing.T) {
1336 repo := ghrepo.NewWithHost("owner", "gh-bin-ext", "example.com")
1337
1338 reg := httpmock.Registry{}
1339 defer reg.Verify(t)
1340
1341 reg.Register(
1342 httpmock.REST("GET", "api/v3/repos/owner/gh-bin-ext/releases/latest"),
1343 httpmock.StatusStringResponse(404, `{}`))
1344 reg.Register(
1345 httpmock.REST("GET", "api/v3/repos/owner/gh-bin-ext"),
1346 httpmock.StatusStringResponse(404, `{}`))
1347
1348 ios, _, stdout, stderr := iostreams.Test()
1349 dataDir := t.TempDir()
1350 updateDir := t.TempDir()
1351
1352 m := newTestManager(dataDir, updateDir, &http.Client{Transport: &reg}, nil, ios)
1353
1354 if err := m.Install(repo, ""); err != repositoryNotFoundErr {
1355 t.Errorf("expected repositoryNotFoundErr, got: %v", err)
1356 }
1357
1358 assert.Equal(t, "", stdout.String())
1359 assert.Equal(t, "", stderr.String())
1360}
1361
1362func TestManager_Create(t *testing.T) {
1363 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 11

VerifyMethod · 0.95
RegisterMethod · 0.95
NewWithHostFunction · 0.92
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
TestFunction · 0.92
newTestManagerFunction · 0.85
EqualMethod · 0.80
InstallMethod · 0.65
ErrorfMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected