forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on Header
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
78374caa41
commit
b8f86f1a60
4 changed files with 45 additions and 5 deletions
|
@ -65,16 +65,13 @@ func TestHeader_StableMarshal(t *testing.T) {
|
|||
from := generateHeader(500)
|
||||
from.SetSplit(split)
|
||||
|
||||
transport := new(grpc.Header)
|
||||
|
||||
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.Header)
|
||||
require.NoError(t, to.Unmarshal(wire))
|
||||
|
||||
to := object.HeaderFromGRPCMessage(transport)
|
||||
require.Equal(t, from, to)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue