Skip to content

Commit

Permalink
main_test: create empty dir on demand
Browse files Browse the repository at this point in the history
Can't checkin an empty directory.
  • Loading branch information
fsouza committed Oct 11, 2019
1 parent 970dcd0 commit 4c1d574
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main

import (
"io/ioutil"
"os"
"testing"

"github.com/fsouza/fake-gcs-server/fakestorage"
Expand All @@ -14,6 +15,20 @@ import (
"github.com/sirupsen/logrus"
)

func TestMain(m *testing.M) {
const emptyBucketDir = "testdata/basic/empty-bucket"
err := os.Mkdir(emptyBucketDir, 0755)
if err != nil {
panic(err)
}
var status int
defer func() {
os.Remove(emptyBucketDir)
os.Exit(status)
}()
status = m.Run()
}

func TestGenerateObjectsFromFiles(t *testing.T) {
t.Parallel()
tests := []struct {
Expand Down

0 comments on commit 4c1d574

Please sign in to comment.