Cleanup and make a safer code (#5794)

This commit is contained in:
Harshavardhana
2018-04-21 20:51:53 -07:00
committed by kannappanr
parent 76cc65531c
commit 954142a98f
5 changed files with 27 additions and 18 deletions
+5 -1
View File
@@ -17,6 +17,7 @@
package cmd
import (
"context"
"fmt"
"os"
"testing"
@@ -99,7 +100,10 @@ func TestListLocksInfo(t *testing.T) {
}
for i, test := range testCases {
actual := listLocksInfo(test.bucket, test.prefix, test.duration)
actual, err := objAPI.ListLocks(context.Background(), test.bucket, test.prefix, test.duration)
if err != nil {
t.Errorf("Test %d - Expected success, got %s", i+1, err)
}
if len(actual) != test.numLocks {
t.Errorf("Test %d - Expected %d locks but observed %d locks",
i+1, test.numLocks, len(actual))