forked from TrueCloudLab/frostfs-api-go
Airat Arifullin
387b850e5e
* Generate protobufs. * Make marshallers, unmarshallers, json-encoders etc. * Create message encoding/decoding unit-tests. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
30 lines
834 B
Go
30 lines
834 B
Go
package apemanager_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status"
|
|
statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestStatusCodes(t *testing.T) {
|
|
statustest.TestCodes(t, apemanager.LocalizeFailStatus, apemanager.GlobalizeFail,
|
|
apemanager.StatusAPEManagerAccessDenied, 5120,
|
|
)
|
|
}
|
|
|
|
func TestAccessDeniedDesc(t *testing.T) {
|
|
var st status.Status
|
|
|
|
require.Empty(t, apemanager.ReadAccessDeniedDesc(st))
|
|
|
|
const desc = "some description"
|
|
|
|
apemanager.WriteAccessDeniedDesc(&st, desc)
|
|
require.Equal(t, desc, apemanager.ReadAccessDeniedDesc(st))
|
|
|
|
apemanager.WriteAccessDeniedDesc(&st, desc+"1")
|
|
require.Equal(t, desc+"1", apemanager.ReadAccessDeniedDesc(st))
|
|
}
|