MCPcopy Create free account
hub / github.com/auth0/auth0-cli / createZip

Function createZip

internal/utils/unzip_test.go:11–30  ·  view source on GitHub ↗
(t *testing.T, zipPath string, files map[string]string)

Source from the content-addressed store, hash-verified

9)
10
11func createZip(t *testing.T, zipPath string, files map[string]string) {
12 out, err := os.Create(zipPath)
13 if err != nil {
14 t.Fatal(err)
15 }
16 defer out.Close()
17
18 zipWriter := zip.NewWriter(out)
19 defer zipWriter.Close()
20
21 for name, content := range files {
22 w, err := zipWriter.Create(name)
23 if err != nil {
24 t.Fatal(err)
25 }
26 if _, err := w.Write([]byte(content)); err != nil {
27 t.Fatal(err)
28 }
29 }
30}
31
32func TestUnzip_Success(t *testing.T) {
33 tmpDir := t.TempDir()

Callers 1

TestUnzip_SuccessFunction · 0.85

Calls 3

CloseMethod · 0.80
WriteMethod · 0.80
CreateMethod · 0.65

Tested by

no test coverage detected