ineffassign fixes (#2758)

This commit is contained in:
Karthic Rao 2016-09-22 11:33:54 +05:30 committed by Harshavardhana
parent f7430ec09c
commit 1148f95292
3 changed files with 19 additions and 1 deletions

View File

@ -71,12 +71,16 @@ func TestFSIsUploadExists(t *testing.T) {
fs := obj.(fsObjects) fs := obj.(fsObjects)
var uploadID string
bucketName := "bucket" bucketName := "bucket"
objectName := "object" objectName := "object"
obj.MakeBucket(bucketName) obj.MakeBucket(bucketName)
uploadID, err := obj.NewMultipartUpload(bucketName, objectName, nil) uploadID, err = obj.NewMultipartUpload(bucketName, objectName, nil)
if err != nil {
t.Fatal("Cannot create a new FS object: ", err)
}
// Test with valid upload id // Test with valid upload id
if exists := fs.isUploadIDExists(bucketName, objectName, uploadID); !exists { if exists := fs.isUploadIDExists(bucketName, objectName, uploadID); !exists {
t.Fatal("Wrong result, expected: ", exists) t.Fatal("Wrong result, expected: ", exists)
@ -118,6 +122,10 @@ func TestFSWriteUploadJSON(t *testing.T) {
obj.MakeBucket(bucketName) obj.MakeBucket(bucketName)
uploadID, err := obj.NewMultipartUpload(bucketName, objectName, nil) uploadID, err := obj.NewMultipartUpload(bucketName, objectName, nil)
if err != nil {
t.Fatal("Unexpected err: ", err)
}
if err := fs.writeUploadJSON(bucketName, objectName, uploadID, time.Now().UTC()); err != nil { if err := fs.writeUploadJSON(bucketName, objectName, uploadID, time.Now().UTC()); err != nil {
t.Fatal("Unexpected err: ", err) t.Fatal("Unexpected err: ", err)
} }

View File

@ -108,6 +108,10 @@ func TestFSLoadFormatFS(t *testing.T) {
defer removeAll(disk) defer removeAll(disk)
obj, err := newFSObjects(disk) obj, err := newFSObjects(disk)
if err != nil {
t.Fatal("Should not fail here", err)
}
fs := obj.(fsObjects) fs := obj.(fsObjects)
// Regular format loading // Regular format loading
@ -137,6 +141,10 @@ func TestFSGetBucketInfo(t *testing.T) {
defer removeAll(disk) defer removeAll(disk)
obj, err := newFSObjects(disk) obj, err := newFSObjects(disk)
if err != nil {
t.Fatal(err)
}
fs := obj.(fsObjects) fs := obj.(fsObjects)
bucketName := "bucket" bucketName := "bucket"

View File

@ -1463,6 +1463,8 @@ func (s *TestSuiteCommon) TestListObjectsHandler(c *C) {
c.Assert(response.StatusCode, Equals, http.StatusOK) c.Assert(response.StatusCode, Equals, http.StatusOK)
getContent, err = ioutil.ReadAll(response.Body) getContent, err = ioutil.ReadAll(response.Body)
c.Assert(err, IsNil)
c.Assert(strings.Contains(string(getContent), "<Key>bar</Key>"), Equals, true) c.Assert(strings.Contains(string(getContent), "<Key>bar</Key>"), Equals, true)
c.Assert(strings.Contains(string(getContent), "<Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner>"), Equals, true) c.Assert(strings.Contains(string(getContent), "<Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner>"), Equals, true)