Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove zip files that were generated as a result of a test. #175

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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