MCPcopy Index your code
hub / github.com/cli/cli / Test_extractZip

Function Test_extractZip

internal/zip/zip_test.go:13–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func Test_extractZip(t *testing.T) {
14 tmpDir := t.TempDir()
15 extractPath, err := safepaths.ParseAbsolute(filepath.Join(tmpDir, "artifact"))
16 require.NoError(t, err)
17
18 zipFile, err := zip.OpenReader("./fixtures/myproject.zip")
19 require.NoError(t, err)
20 defer zipFile.Close()
21
22 err = ExtractZip(&zipFile.Reader, extractPath)
23 require.NoError(t, err)
24
25 _, err = os.Stat(filepath.Join(extractPath.String(), "src", "main.go"))
26 require.NoError(t, err)
27}

Callers

nothing calls this directly

Calls 5

ParseAbsoluteFunction · 0.92
ExtractZipFunction · 0.85
JoinMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected