forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on ShortHeader
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a684da6118
commit
ce0d70fa02
4 changed files with 59 additions and 4 deletions
20
v2/object/json_test.go
Normal file
20
v2/object/json_test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package object_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/object"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestShortHeaderJSON(t *testing.T) {
|
||||
h := generateShortHeader("id")
|
||||
|
||||
data, err := h.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
h2 := new(object.ShortHeader)
|
||||
require.NoError(t, h2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue