Enable browser support for gateway (#4425)

This commit is contained in:
poornas
2017-06-01 09:43:20 -07:00
committed by Harshavardhana
parent 64f4dbc272
commit 18c4e5d357
38 changed files with 260 additions and 146 deletions

View File

@@ -66,7 +66,7 @@ func TestFSShutdown(t *testing.T) {
obj := initFSObjects(disk, t)
fs := obj.(*fsObjects)
objectContent := "12345"
obj.MakeBucket(bucketName)
obj.MakeBucketWithLocation(bucketName, "")
sha256sum := ""
obj.PutObject(bucketName, objectName, int64(len(objectContent)), bytes.NewReader([]byte(objectContent)), nil, sha256sum)
return fs, disk
@@ -498,7 +498,7 @@ func TestFSGetBucketInfo(t *testing.T) {
fs := obj.(*fsObjects)
bucketName := "bucket"
obj.MakeBucket(bucketName)
obj.MakeBucketWithLocation(bucketName, "")
// Test with valid parameters
info, err := fs.GetBucketInfo(bucketName)
@@ -533,7 +533,7 @@ func TestFSPutObject(t *testing.T) {
bucketName := "bucket"
objectName := "1/2/3/4/object"
if err := obj.MakeBucket(bucketName); err != nil {
if err := obj.MakeBucketWithLocation(bucketName, ""); err != nil {
t.Fatal(err)
}
@@ -603,7 +603,7 @@ func TestFSDeleteObject(t *testing.T) {
bucketName := "bucket"
objectName := "object"
obj.MakeBucket(bucketName)
obj.MakeBucketWithLocation(bucketName, "")
sha256sum := ""
obj.PutObject(bucketName, objectName, int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil, sha256sum)
@@ -648,7 +648,7 @@ func TestFSDeleteBucket(t *testing.T) {
fs := obj.(*fsObjects)
bucketName := "bucket"
err := obj.MakeBucket(bucketName)
err := obj.MakeBucketWithLocation(bucketName, "")
if err != nil {
t.Fatal("Unexpected error: ", err)
}
@@ -666,7 +666,7 @@ func TestFSDeleteBucket(t *testing.T) {
t.Fatal("Unexpected error: ", err)
}
obj.MakeBucket(bucketName)
obj.MakeBucketWithLocation(bucketName, "")
// Delete bucker should get error disk not found.
removeAll(disk)
@@ -687,7 +687,7 @@ func TestFSListBuckets(t *testing.T) {
fs := obj.(*fsObjects)
bucketName := "bucket"
if err := obj.MakeBucket(bucketName); err != nil {
if err := obj.MakeBucketWithLocation(bucketName, ""); err != nil {
t.Fatal("Unexpected error: ", err)
}