ineffassign fixes (#2758)

master
Karthic Rao 8 years ago committed by Harshavardhana
parent f7430ec09c
commit 1148f95292
  1. 10
      cmd/fs-v1-multipart-common_test.go
  2. 8
      cmd/fs-v1_test.go
  3. 2
      cmd/server_test.go

@ -71,12 +71,16 @@ func TestFSIsUploadExists(t *testing.T) {
fs := obj.(fsObjects)
var uploadID string
bucketName := "bucket"
objectName := "object"
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
if exists := fs.isUploadIDExists(bucketName, objectName, uploadID); !exists {
t.Fatal("Wrong result, expected: ", exists)
@ -118,6 +122,10 @@ func TestFSWriteUploadJSON(t *testing.T) {
obj.MakeBucket(bucketName)
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 {
t.Fatal("Unexpected err: ", err)
}

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

@ -1463,6 +1463,8 @@ func (s *TestSuiteCommon) TestListObjectsHandler(c *C) {
c.Assert(response.StatusCode, Equals, http.StatusOK)
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), "<Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner>"), Equals, true)

Loading…
Cancel
Save