Skip to content

Commit 332a034

Browse files
committed
Remove zip files that were generated as a result of a test.
1 parent c16f42e commit 332a034

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

internal/provider/zip_archiver_test.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
func TestZipArchiver_Content(t *testing.T) {
1515
zipfilepath := "archive-content.zip"
1616
archiver := NewZipArchiver(zipfilepath)
17+
defer os.Remove(zipfilepath)
1718
if err := archiver.ArchiveContent([]byte("This is some content"), "content.txt"); err != nil {
1819
t.Fatalf("unexpected error: %s", err)
1920
}
@@ -50,13 +51,16 @@ func TestZipArchiver_FileMode(t *testing.T) {
5051

5152
stringArray := [5]string{"0444", "0644", "0666", "0744", "0777"}
5253
for _, element := range stringArray {
53-
archiver := NewZipArchiver(zipFilePath)
54-
archiver.SetOutputFileMode(element)
55-
if err := archiver.ArchiveFile(toZipPath); err != nil {
56-
t.Fatalf("unexpected error: %s", err)
57-
}
58-
59-
ensureFileMode(t, zipFilePath, element)
54+
func() {
55+
archiver := NewZipArchiver(zipFilePath)
56+
defer os.Remove(zipFilePath)
57+
archiver.SetOutputFileMode(element)
58+
if err := archiver.ArchiveFile(toZipPath); err != nil {
59+
t.Fatalf("unexpected error: %s", err)
60+
}
61+
62+
ensureFileMode(t, zipFilePath, element)
63+
}()
6064
}
6165
}
6266

0 commit comments

Comments
 (0)