forked from TrueCloudLab/frostfs-api-go
[#198] sdk: Implement XHeader type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
5f5e5ac5dd
commit
5452554b58
2 changed files with 72 additions and 0 deletions
25
pkg/xheader_test.go
Normal file
25
pkg/xheader_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package pkg
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestXHeader(t *testing.T) {
|
||||
x := NewXHeader()
|
||||
|
||||
key := "some key"
|
||||
val := "some value"
|
||||
|
||||
x.SetKey(key)
|
||||
x.SetValue(val)
|
||||
|
||||
require.Equal(t, key, x.Key())
|
||||
require.Equal(t, val, x.Value())
|
||||
|
||||
xV2 := x.ToV2()
|
||||
|
||||
require.Equal(t, key, xV2.GetKey())
|
||||
require.Equal(t, val, xV2.GetValue())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue