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
|
@ -15,16 +15,14 @@ import (
|
|||
|
||||
func TestShortHeader_StableMarshal(t *testing.T) {
|
||||
hdrFrom := generateShortHeader("Owner ID")
|
||||
transport := new(grpc.ShortHeader)
|
||||
|
||||
t.Run("non empty", func(t *testing.T) {
|
||||
wire, err := hdrFrom.StableMarshal(nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = goproto.Unmarshal(wire, transport)
|
||||
require.NoError(t, err)
|
||||
hdrTo := new(object.ShortHeader)
|
||||
require.NoError(t, hdrTo.Unmarshal(wire))
|
||||
|
||||
hdrTo := object.ShortHeaderFromGRPCMessage(transport)
|
||||
require.Equal(t, hdrFrom, hdrTo)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue