forked from TrueCloudLab/frostfs-api-go
[#140] sdk/object: Define Attribute type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
5902f96f3e
commit
20d644758b
2 changed files with 68 additions and 0 deletions
23
pkg/object/attribute_test.go
Normal file
23
pkg/object/attribute_test.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAttribute(t *testing.T) {
|
||||
key, val := "some key", "some value"
|
||||
|
||||
a := NewAttribute()
|
||||
a.SetKey(key)
|
||||
a.SetValue(val)
|
||||
|
||||
require.Equal(t, key, a.GetKey())
|
||||
require.Equal(t, val, a.GetValue())
|
||||
|
||||
aV2 := a.ToV2()
|
||||
|
||||
require.Equal(t, key, aV2.GetKey())
|
||||
require.Equal(t, val, aV2.GetValue())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue