api: Add bucket notification util tests. (#2289)

This commit is contained in:
Harshavardhana
2016-07-26 00:01:35 -07:00
committed by GitHub
parent 530ed67b59
commit 1f9e38e3cd
8 changed files with 337 additions and 75 deletions
+4 -28
View File
@@ -126,23 +126,11 @@ func TestNewJWT(t *testing.T) {
// Tests JWT.GenerateToken()
func TestGenerateToken(t *testing.T) {
savedServerConfig := serverConfig
defer func() {
serverConfig = savedServerConfig
}()
serverConfig = nil
// Setup.
testPath, err := ioutil.TempDir("", "minio-")
testPath, err := newTestConfig("us-east-1")
if err != nil {
t.Fatalf("Unable to create a temporary directory, %s", err)
}
defer removeAll(testPath)
setGlobalConfigPath(testPath)
if err = initConfig(); err != nil {
t.Fatalf("unable initialize config file, %s", err)
}
defer removeAll(testPath)
jwt, err := newJWT()
if err != nil {
@@ -185,23 +173,11 @@ func TestGenerateToken(t *testing.T) {
// Tests JWT.Authenticate()
func TestAuthenticate(t *testing.T) {
savedServerConfig := serverConfig
defer func() {
serverConfig = savedServerConfig
}()
serverConfig = nil
// Setup.
testPath, err := ioutil.TempDir("", "minio-")
testPath, err := newTestConfig("us-east-1")
if err != nil {
t.Fatalf("Unable to create a temporary directory, %s", err)
}
defer removeAll(testPath)
setGlobalConfigPath(testPath)
if err = initConfig(); err != nil {
t.Fatalf("unable initialize config file, %s", err)
}
defer removeAll(testPath)
jwt, err := newJWT()
if err != nil {