From f709083e47f04bcf62b83762a9473a0bd02d3abd Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Wed, 12 Jun 2019 10:00:46 +0200 Subject: [PATCH] api: temporary fix test failing on windows due to access denied (#1450) --- api/filesystem_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/filesystem_test.go b/api/filesystem_test.go index b054ec61df..4cff868037 100644 --- a/api/filesystem_test.go +++ b/api/filesystem_test.go @@ -29,8 +29,6 @@ import ( "github.com/ethersphere/swarm/storage" ) -var testDownloadDir, _ = ioutil.TempDir(os.TempDir(), "bzz-test") - func testFileSystem(t *testing.T, f func(*FileSystem, bool)) { testAPI(t, func(api *API, _ *chunk.Tags, toEncrypt bool) { f(NewFileSystem(api), toEncrypt) @@ -70,8 +68,13 @@ func TestApiDirUpload0(t *testing.T) { t.Fatalf("expected error: %v", err) } + testDownloadDir, err := ioutil.TempDir(os.TempDir(), "bzz-test") downloadDir := filepath.Join(testDownloadDir, "test0") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } defer os.RemoveAll(downloadDir) + err = fs.Download(bzzhash, downloadDir) if err != nil { t.Fatalf("unexpected error: %v", err)