parent
21dbe3ea8e
commit
9152b084ec
3 changed files with 11 additions and 11 deletions
|
@ -301,9 +301,9 @@ func TestMultipartUploadWithContentLanguage(t *testing.T) {
|
||||||
createTestBucket(hc, bktName)
|
createTestBucket(hc, bktName)
|
||||||
|
|
||||||
partSize := 5 * 1024 * 1024
|
partSize := 5 * 1024 * 1024
|
||||||
exceptedContentLanguage := "en"
|
expectedContentLanguage := "en"
|
||||||
headers := map[string]string{
|
headers := map[string]string{
|
||||||
api.ContentLanguage: exceptedContentLanguage,
|
api.ContentLanguage: expectedContentLanguage,
|
||||||
}
|
}
|
||||||
|
|
||||||
multipartUpload := createMultipartUpload(hc, bktName, objName, headers)
|
multipartUpload := createMultipartUpload(hc, bktName, objName, headers)
|
||||||
|
@ -314,7 +314,7 @@ func TestMultipartUploadWithContentLanguage(t *testing.T) {
|
||||||
|
|
||||||
w, r := prepareTestRequest(hc, bktName, objName, nil)
|
w, r := prepareTestRequest(hc, bktName, objName, nil)
|
||||||
hc.Handler().HeadObjectHandler(w, r)
|
hc.Handler().HeadObjectHandler(w, r)
|
||||||
require.Equal(t, exceptedContentLanguage, w.Header().Get(api.ContentLanguage))
|
require.Equal(t, expectedContentLanguage, w.Header().Get(api.ContentLanguage))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMultipartUploadEnabledMD5(t *testing.T) {
|
func TestMultipartUploadEnabledMD5(t *testing.T) {
|
||||||
|
|
|
@ -453,14 +453,14 @@ func getObjectAttribute(obj *object.Object, attrName string) string {
|
||||||
func TestPutObjectWithContentLanguage(t *testing.T) {
|
func TestPutObjectWithContentLanguage(t *testing.T) {
|
||||||
tc := prepareHandlerContext(t)
|
tc := prepareHandlerContext(t)
|
||||||
|
|
||||||
exceptedContentLanguage := "en"
|
expectedContentLanguage := "en"
|
||||||
bktName, objName := "bucket-1", "object-1"
|
bktName, objName := "bucket-1", "object-1"
|
||||||
createTestBucket(tc, bktName)
|
createTestBucket(tc, bktName)
|
||||||
|
|
||||||
w, r := prepareTestRequest(tc, bktName, objName, nil)
|
w, r := prepareTestRequest(tc, bktName, objName, nil)
|
||||||
r.Header.Set(api.ContentLanguage, exceptedContentLanguage)
|
r.Header.Set(api.ContentLanguage, expectedContentLanguage)
|
||||||
tc.Handler().PutObjectHandler(w, r)
|
tc.Handler().PutObjectHandler(w, r)
|
||||||
|
|
||||||
tc.Handler().HeadObjectHandler(w, r)
|
tc.Handler().HeadObjectHandler(w, r)
|
||||||
require.Equal(t, exceptedContentLanguage, w.Header().Get(api.ContentLanguage))
|
require.Equal(t, expectedContentLanguage, w.Header().Get(api.ContentLanguage))
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,7 +185,7 @@ func TestGetLatestNode(t *testing.T) {
|
||||||
for _, tc := range []struct {
|
for _, tc := range []struct {
|
||||||
name string
|
name string
|
||||||
nodes []NodeResponse
|
nodes []NodeResponse
|
||||||
exceptedNodeID uint64
|
expectedNodeID uint64
|
||||||
error bool
|
error bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
|
@ -208,7 +208,7 @@ func TestGetLatestNode(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
exceptedNodeID: 1,
|
expectedNodeID: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "one node of the object version and one node of the secondary object",
|
name: "one node of the object version and one node of the secondary object",
|
||||||
|
@ -231,7 +231,7 @@ func TestGetLatestNode(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
exceptedNodeID: 1,
|
expectedNodeID: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "all nodes represent a secondary object",
|
name: "all nodes represent a secondary object",
|
||||||
|
@ -289,7 +289,7 @@ func TestGetLatestNode(t *testing.T) {
|
||||||
meta: []nodeMeta{},
|
meta: []nodeMeta{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
exceptedNodeID: 4,
|
expectedNodeID: 4,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
@ -300,7 +300,7 @@ func TestGetLatestNode(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, tc.exceptedNodeID, actualNode.GetNodeID())
|
require.Equal(t, tc.expectedNodeID, actualNode.GetNodeID())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue