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

Function TestDeferredRepositoryCleanup

acceptance/fixture_repository_test.go:304–325  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

302}
303
304func TestDeferredRepositoryCleanup(t *testing.T) {
305 file := filepath.Join(t.TempDir(), "cleanup.txt")
306 require.NoError(t, os.WriteFile(file, []byte("fixture-repo none\ndefer cleanup-repo stale-repo\n"), 0o600))
307
308 client := &fakeFixtureRepositoryClient{}
309 manager := &fixtureRepositoryManager{client: client}
310 tsEnv := testScriptEnv{
311 host: "github.com",
312 org: "example",
313 token: "ghs_token",
314 }
315 t.Run("script", func(t *testing.T) {
316 testscript.Run(t, testscript.Params{
317 Files: []string{file},
318 Setup: sharedSetup(tsEnv),
319 Cmds: sharedCmds(tsEnv, manager),
320 RequireExplicitExec: true,
321 })
322 })
323
324 assert.Equal(t, []string{"stale-repo"}, client.deleted)
325}
326
327func TestManagedFixtureRejectsRepositoryCreation(t *testing.T) {
328 file := filepath.Join(t.TempDir(), "managed.txt")

Callers

nothing calls this directly

Calls 5

sharedSetupFunction · 0.85
sharedCmdsFunction · 0.85
JoinMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected