[#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
parent
5361f0eceb
commit
6ce73790ea
337 changed files with 66666 additions and 283 deletions
35
api/object/status_test.go
Normal file
35
api/object/status_test.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package object_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status"
|
||||
statustest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/status/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestStatusCodes(t *testing.T) {
|
||||
statustest.TestCodes(t, object.LocalizeFailStatus, object.GlobalizeFail,
|
||||
object.StatusAccessDenied, 2048,
|
||||
object.StatusNotFound, 2049,
|
||||
object.StatusLocked, 2050,
|
||||
object.StatusLockNonRegularObject, 2051,
|
||||
object.StatusAlreadyRemoved, 2052,
|
||||
object.StatusOutOfRange, 2053,
|
||||
)
|
||||
}
|
||||
|
||||
func TestAccessDeniedDesc(t *testing.T) {
|
||||
var st status.Status
|
||||
|
||||
require.Empty(t, object.ReadAccessDeniedDesc(st))
|
||||
|
||||
const desc = "some description"
|
||||
|
||||
object.WriteAccessDeniedDesc(&st, desc)
|
||||
require.Equal(t, desc, object.ReadAccessDeniedDesc(st))
|
||||
|
||||
object.WriteAccessDeniedDesc(&st, desc+"1")
|
||||
require.Equal(t, desc+"1", object.ReadAccessDeniedDesc(st))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue