forked from TrueCloudLab/frostfs-node
[#1090] ape: Move ape request and resource implementations to common package
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
661faa639e
commit
f4dcb418f2
5 changed files with 144 additions and 114 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"testing"
|
||||
|
||||
objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
||||
aperequest "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/ape/request"
|
||||
checksumtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum/test"
|
||||
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
||||
|
@ -256,22 +257,21 @@ func TestNewAPERequest(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
expectedRequest := request{
|
||||
operation: method,
|
||||
resource: resource{
|
||||
name: resourceName(cnr, obj, prm.Namespace),
|
||||
properties: objectProperties(cnr, obj, testCnrOwner, func() *objectV2.Header {
|
||||
expectedRequest := aperequest.NewRequest(
|
||||
method,
|
||||
aperequest.NewResource(
|
||||
resourceName(cnr, obj, prm.Namespace),
|
||||
objectProperties(cnr, obj, testCnrOwner, func() *objectV2.Header {
|
||||
if headerObjSDK != nil {
|
||||
return headerObjSDK.ToV2().GetHeader()
|
||||
}
|
||||
return prm.Header
|
||||
}()),
|
||||
},
|
||||
properties: map[string]string{
|
||||
}())),
|
||||
map[string]string{
|
||||
nativeschema.PropertyKeyActorPublicKey: prm.SenderKey,
|
||||
nativeschema.PropertyKeyActorRole: prm.Role,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
require.Equal(t, expectedRequest, r)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue