forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on Object
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9cdd14841a
commit
9325e22871
7 changed files with 102 additions and 15 deletions
|
@ -78,16 +78,14 @@ func TestHeader_StableMarshal(t *testing.T) {
|
|||
|
||||
func TestObject_StableMarshal(t *testing.T) {
|
||||
from := generateObject("Payload")
|
||||
transport := new(grpc.Object)
|
||||
|
||||
t.Run("non empty", func(t *testing.T) {
|
||||
wire, err := from.StableMarshal(nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = goproto.Unmarshal(wire, transport)
|
||||
require.NoError(t, err)
|
||||
to := new(object.Object)
|
||||
require.NoError(t, to.Unmarshal(wire))
|
||||
|
||||
to := object.ObjectFromGRPCMessage(transport)
|
||||
require.Equal(t, from, to)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue