[#132] v2/object: Implement stable unmarshaler on Object

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-02 14:46:43 +03:00 committed by Stanislav Bogatyrev
parent c125749c6e
commit e222c441e5
2 changed files with 28 additions and 0 deletions

View file

@ -688,3 +688,15 @@ func generateRangeHashResponseBody(n int) *object.GetRangeHashResponseBody {
return resp
}
func TestObject_StableUnmarshal(t *testing.T) {
obj := generateObject("some data")
data, err := obj.StableMarshal(nil)
require.NoError(t, err)
obj2 := new(object.Object)
require.NoError(t, obj2.StableUnmarshal(data))
require.Equal(t, obj, obj2)
}