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
|
@ -66,3 +66,15 @@ func TestHeaderWithSignatureJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
||||
func TestObjectJSON(t *testing.T) {
|
||||
o := generateObject("data")
|
||||
|
||||
data, err := o.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
o2 := new(object.Object)
|
||||
require.NoError(t, o2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, o, o2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue