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

Function TestManager_repo_not_found

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

Source from the content-addressed store, hash-verified

1257}
1258
1259func TestManager_repo_not_found(t *testing.T) {
1260 repo := ghrepo.NewWithHost("owner", "gh-bin-ext", "example.com")
1261
1262 reg := httpmock.Registry{}
1263 defer reg.Verify(t)
1264
1265 reg.Register(
1266 httpmock.REST("GET", "api/v3/repos/owner/gh-bin-ext/releases/latest"),
1267 httpmock.StatusStringResponse(404, `{}`))
1268 reg.Register(
1269 httpmock.REST("GET", "api/v3/repos/owner/gh-bin-ext"),
1270 httpmock.StatusStringResponse(404, `{}`))
1271
1272 ios, _, stdout, stderr := iostreams.Test()
1273 dataDir := t.TempDir()
1274 updateDir := t.TempDir()
1275
1276 m := newTestManager(dataDir, updateDir, &http.Client{Transport: &reg}, nil, ios)
1277
1278 if err := m.Install(repo, ""); err != repositoryNotFoundErr {
1279 t.Errorf("expected repositoryNotFoundErr, got: %v", err)
1280 }
1281
1282 assert.Equal(t, "", stdout.String())
1283 assert.Equal(t, "", stderr.String())
1284}
1285
1286func TestManager_Create(t *testing.T) {
1287 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.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…