forked from TrueCloudLab/frostfs-api-go
[#168] object: Implement binary/JSON encoders/decoders on Attribute
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
ce0d70fa02
commit
0caff85fb7
6 changed files with 103 additions and 4 deletions
|
@ -18,3 +18,15 @@ func TestShortHeaderJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, h, h2)
|
||||
}
|
||||
|
||||
func TestAttributeJSON(t *testing.T) {
|
||||
a := generateAttribute("key", "value")
|
||||
|
||||
data, err := a.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
a2 := new(object.Attribute)
|
||||
require.NoError(t, a2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, a, a2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue