|
|
|
@ -29,6 +29,7 @@ func TestListObjectsV2Resources(t *testing.T) { |
|
|
|
|
fetchOwner bool |
|
|
|
|
maxKeys int |
|
|
|
|
encodingType string |
|
|
|
|
errCode APIErrorCode |
|
|
|
|
}{ |
|
|
|
|
{ |
|
|
|
|
values: url.Values{ |
|
|
|
@ -47,6 +48,7 @@ func TestListObjectsV2Resources(t *testing.T) { |
|
|
|
|
fetchOwner: true, |
|
|
|
|
maxKeys: 100, |
|
|
|
|
encodingType: "gzip", |
|
|
|
|
errCode: ErrNone, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
values: url.Values{ |
|
|
|
@ -64,11 +66,34 @@ func TestListObjectsV2Resources(t *testing.T) { |
|
|
|
|
fetchOwner: true, |
|
|
|
|
maxKeys: 1000, |
|
|
|
|
encodingType: "gzip", |
|
|
|
|
errCode: ErrNone, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
values: url.Values{ |
|
|
|
|
"prefix": []string{"photos/"}, |
|
|
|
|
"continuation-token": []string{""}, |
|
|
|
|
"start-after": []string{"start-after"}, |
|
|
|
|
"delimiter": []string{"/"}, |
|
|
|
|
"fetch-owner": []string{"true"}, |
|
|
|
|
"encoding-type": []string{"gzip"}, |
|
|
|
|
}, |
|
|
|
|
prefix: "", |
|
|
|
|
token: "", |
|
|
|
|
startAfter: "", |
|
|
|
|
delimiter: "", |
|
|
|
|
fetchOwner: false, |
|
|
|
|
maxKeys: 0, |
|
|
|
|
encodingType: "", |
|
|
|
|
errCode: ErrIncorrectContinuationToken, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for i, testCase := range testCases { |
|
|
|
|
prefix, token, startAfter, delimiter, fetchOwner, maxKeys, encodingType := getListObjectsV2Args(testCase.values) |
|
|
|
|
prefix, token, startAfter, delimiter, fetchOwner, maxKeys, encodingType, errCode := getListObjectsV2Args(testCase.values) |
|
|
|
|
|
|
|
|
|
if errCode != testCase.errCode { |
|
|
|
|
t.Errorf("Test %d: Expected error code:%d, got %d", i+1, testCase.errCode, errCode) |
|
|
|
|
} |
|
|
|
|
if prefix != testCase.prefix { |
|
|
|
|
t.Errorf("Test %d: Expected %s, got %s", i+1, testCase.prefix, prefix) |
|
|
|
|
} |
|
|
|
|