|
|
@ -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) |
|
|
|
} |
|
|
|
} |
|
|
|