test
This commit is contained in:
24
src/kubectl/main_test.go
Normal file
24
src/kubectl/main_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package kubectl
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var TEST_DEST_DIR = "../wrk_kubectl"
|
||||
var TEST_SRC_DIR = filepath.Join("../../test", "kubectl")
|
||||
var TEST_BIN_DIR = filepath.Join("../../test", "bin")
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
folderPath := TEST_DEST_DIR
|
||||
|
||||
os.RemoveAll(folderPath)
|
||||
os.MkdirAll(folderPath, os.ModePerm)
|
||||
|
||||
// call flag.Parse() here if TestMain uses flags
|
||||
exitCode := m.Run()
|
||||
|
||||
os.RemoveAll(folderPath)
|
||||
os.Exit(exitCode)
|
||||
}
|
Reference in New Issue
Block a user