From 0780cdb04ff319823983b8a3bfbb9ba615227941 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 21 Oct 2015 12:50:56 +0800 Subject: [PATCH] . --- tmp/README.md | 1 + util/zip_test.go | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 tmp/README.md diff --git a/tmp/README.md b/tmp/README.md new file mode 100644 index 0000000..8dfb0c8 --- /dev/null +++ b/tmp/README.md @@ -0,0 +1 @@ +This directory is used to unit-test. \ No newline at end of file diff --git a/util/zip_test.go b/util/zip_test.go index cb11abd..4e98119 100644 --- a/util/zip_test.go +++ b/util/zip_test.go @@ -20,8 +20,7 @@ import ( "testing" ) -var tempDir = "../" -var testDir = filepath.Join(tempDir, "wide-test") +var testDir = "../tmp" var packageName = filepath.Join(testDir, "test_zip") func TestCreate(t *testing.T) { @@ -57,19 +56,15 @@ func TestUnzip(t *testing.T) { } func TestMain(m *testing.M) { - err := os.Mkdir(testDir, 0644) - if err != nil { - logger.Error(err) - - os.Exit(-1) - } - logger.Info(testDir) retCode := m.Run() // clean test data - os.RemoveAll(testDir) + os.RemoveAll(testDir + "/test_zip") + os.RemoveAll(testDir + "/util") + os.RemoveAll(testDir + "/file.go") + os.RemoveAll(testDir + "/test_zip.zip") os.Exit(retCode) }