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
+2 -14
View File
@@ -27,23 +27,11 @@ import (
// Tests validate bucket LocationConstraint.
func TestIsValidLocationContraint(t *testing.T) {
savedServerConfig := serverConfig
defer func() {
serverConfig = savedServerConfig
}()
serverConfig = nil
// Test initialized config file.
path, err := ioutil.TempDir("", "minio-")
path, err := newTestConfig("us-east-1")
if err != nil {
t.Fatalf("Unable to create a temporary directory, %s", err)
}
defer removeAll(path)
setGlobalConfigPath(path)
if err := initConfig(); err != nil {
t.Fatalf("unable initialize config file, %s", err)
}
defer removeAll(path)
// generates the input request with XML bucket configuration set to the request body.
createExpectedRequest := func(req *http.Request, location string) (*http.Request, error) {