Skip to content

Commit

Permalink
Remove zip files that were generated as a result of a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Ip committed Mar 21, 2023
1 parent bfb513f commit b2ebee8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions internal/provider/zip_archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
func TestZipArchiver_Content(t *testing.T) {
zipfilepath := "archive-content.zip"
archiver := NewZipArchiver(zipfilepath)
defer os.Remove(zipfilepath)
if err := archiver.ArchiveContent([]byte("This is some content"), "content.txt"); err != nil {
t.Fatalf("unexpected error: %s", err)
}
Expand Down Expand Up @@ -50,13 +51,16 @@ func TestZipArchiver_FileMode(t *testing.T) {

stringArray := [5]string{"0444", "0644", "0666", "0744", "0777"}
for _, element := range stringArray {
archiver := NewZipArchiver(zipFilePath)
archiver.SetOutputFileMode(element)
if err := archiver.ArchiveFile(toZipPath); err != nil {
t.Fatalf("unexpected error: %s", err)
}

ensureFileMode(t, zipFilePath, element)
func() {
archiver := NewZipArchiver(zipFilePath)
defer os.Remove(zipFilePath)
archiver.SetOutputFileMode(element)
if err := archiver.ArchiveFile(toZipPath); err != nil {
t.Fatalf("unexpected error: %s", err)
}

ensureFileMode(t, zipFilePath, element)
}()
}
}

Expand Down

0 comments on commit b2ebee8

Please sign in to comment.