mirror of
https://github.com/minio/mc.git
synced 2025-11-12 01:02:26 +03:00
Improve tests add SetUpSuite and TearDownSuite
This commit is contained in:
25
ls_test.go
25
ls_test.go
@@ -21,25 +21,12 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
. "github.com/minio/check"
|
||||
)
|
||||
|
||||
func (s *CmdTestSuite) TestLSNonRecursive(c *C) {
|
||||
configDir, err := ioutil.TempDir(os.TempDir(), "cmd-")
|
||||
c.Assert(err, IsNil)
|
||||
defer os.RemoveAll(configDir)
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
mcConfigWindowsDir = configDir
|
||||
default:
|
||||
mcConfigDir = configDir
|
||||
}
|
||||
_, err = doConfig("generate", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
/// filesystem
|
||||
root, err := ioutil.TempDir(os.TempDir(), "cmd-")
|
||||
c.Assert(err, IsNil)
|
||||
@@ -60,18 +47,6 @@ func (s *CmdTestSuite) TestLSNonRecursive(c *C) {
|
||||
}
|
||||
|
||||
func (s *CmdTestSuite) TestLSRecursive(c *C) {
|
||||
configDir, err := ioutil.TempDir(os.TempDir(), "cmd-")
|
||||
c.Assert(err, IsNil)
|
||||
defer os.RemoveAll(configDir)
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
mcConfigWindowsDir = configDir
|
||||
default:
|
||||
mcConfigDir = configDir
|
||||
}
|
||||
_, err = doConfig("generate", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
/// filesystem
|
||||
root, err := ioutil.TempDir(os.TempDir(), "cmd-")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
Reference in New Issue
Block a user