forked from TrueCloudLab/frostfs-api-go
[#168] container: Implement binary/JSON encoders/decoders on Attribute
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
ec957be60c
commit
bc5d9dcce5
4 changed files with 92 additions and 49 deletions
|
@ -28,3 +28,15 @@ func TestContainerJSON(t *testing.T) {
|
|||
require.Error(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func TestAttributeJSON(t *testing.T) {
|
||||
b := generateAttribute("key", "value")
|
||||
|
||||
data, err := b.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
b2 := new(container.Attribute)
|
||||
require.NoError(t, b2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, b, b2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue